Re: [OT] calling isnan
Re: [OT] calling isnan
- Subject: Re: [OT] calling isnan
- From: Chris Ridd <email@hidden>
- Date: Fri, 18 Feb 2005 21:34:02 +0000
On 18/2/05 9:22 pm, Chris Espinosa <email@hidden> wrote:
> Apparently <cmath> is supposed to #undef isnan, according to the C
> standard. (Why, I'm not sure, but it is.) What it ought to do is to
> define <T>isnan() in the std:: namespace, but it's apparently not doing
> so for doubles.
>
> See this: http://gcc.gnu.org/ml/gcc/2005-01/msg00577.html
>
> As a workaround you can use the __isnand(x) underlying function for
> doubles.
You could also define _GLIBCPP_USE_C99 to 1 before including <cmath>. That
ends up defining an isnan function in the __gnu_cxx namespace.
As an aside, I'm not sure if atof() can actually return something that's
NaN. You're supposed to use strtod() instead of atof(), but I'm not sure
Darwin's strtod() can return a NaN either :-((
Cheers,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden