• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: simple float/double question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple float/double question


  • Subject: Re: simple float/double question
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Fri, 30 May 2003 10:09:24 -0400

On Friday, May 30, 2003, at 02:54 US/Eastern, Lloyd Dupont wrote:

how to test if a float/double is a number or not ?
I mean acos(2) for example return NaN, how to know programatically it's NaN ?

If a number is not equal to itself, then it is a NaN.


double d = ...;

if(d != d)
{
//d is NaN
}

--
http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >simple float/double question (From: Lloyd Dupont <email@hidden>)

  • Prev by Date: Re: Carbon : start-up volume name/path as POSIX
  • Next by Date: How do I create system wide CMM's
  • Previous by thread: Re: simple float/double question
  • Next by thread: Re: simple float/double question
  • Index(es):
    • Date
    • Thread