• 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: [OT] calling isnan
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: [OT] calling isnan (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: [OT] calling isnan
  • Next by Date: Re: [OT] calling isnan
  • Previous by thread: Re: [OT] calling isnan
  • Next by thread: Re: [OT] calling isnan
  • Index(es):
    • Date
    • Thread