Connecting Tech Pros Worldwide Help | Site Map

How do I detect infinite floats?

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 25th, 2006, 04:45 AM
Nialsh
Guest
 
Posts: n/a
Default How do I detect infinite floats?

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


  #2  
Old January 25th, 2006, 08:05 AM
owillebo
Guest
 
Posts: n/a
Default Re: How do I detect infinite floats?

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

  #3  
Old January 25th, 2006, 04:15 PM
red floyd
Guest
 
Posts: n/a
Default 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.
  #4  
Old January 31st, 2006, 10:25 AM
Richard Herring
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.