Connecting Tech Pros Worldwide Help | Site Map

How do I detect infinite floats?

Nialsh
Guest
 
Posts: n/a
#1: Jan 25 '06
I know division by zero is valid in floating point and stores with a
special infinity value but is there a standard constant to cover
testing that or am I supposed to make my own each time?

Thanks
Neal

owillebo
Guest
 
Posts: n/a
#2: Jan 25 '06

re: How do I detect infinite floats?


http://www.gnu.org/software/libc/man...y-and-NaN.html

red floyd
Guest
 
Posts: n/a
#3: Jan 25 '06

re: How do I detect infinite floats?


owillebo wrote:[color=blue]
> http://www.gnu.org/software/libc/man...y-and-NaN.html
>[/color]

check std::numeric_limits<> as well. Doesn't have "is{infinity,nan,...}
but does have methods that return the values for them.
Richard Herring
Guest
 
Posts: n/a
#4: Jan 31 '06

re: How do I detect infinite floats?


In message <5eOBf.35163$dW3.28122@newssvr21.news.prodigy.com> , red floyd
<no.spam@here.dude> writes[color=blue]
>owillebo wrote:[color=green]
>> http://www.gnu.org/software/libc/man...y-and-NaN.html
>>[/color]
>
>check std::numeric_limits<> as well. Doesn't have
>"is{infinity,nan,...} but does have methods that return the values for
>them.[/color]

But don't forget that comparison with NaN may not have the result you
expect ;-)

--
Richard Herring
Closed Thread