Re: simple float/double question
Re: simple float/double question
- Subject: Re: simple float/double question
- From: Andrew Pinski <email@hidden>
- Date: Fri, 30 May 2003 08:37:29 -0400
Even quicker way and faster way because you do not have load in a
floating point constant.
if (x!=x)
{
// x is Nan
}
Thanks,
Andrew Pinski
On Friday, May 30, 2003, at 04:42 US/Eastern, James McCartney wrote:
On Thursday, May 29, 2003, at 11:54 PM, 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 ?
Here's one way:
if (!(x <= 0.0 || x >= 0.0)) {
// x is NaN.
}
NaN fails all magnitude comparisons.
--
--- james mccartney email@hidden
<http://www.audiosynth.com>
SuperCollider - a real time audio synthesis programming language for
MacOS X.
_______________________________________________
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.
_______________________________________________
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.