Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cmath and math.h Changes in Xcode 2.4



I'm not sure why isnan isn't defined for you out of the std namespace (noting that there are a few mentions of FreeBSD isnan issues on Google), but hopefully the following will help:

On 30/08/2006, at 5:07 AM, email@hidden wrote:

Looking around it seems the "safer" way to do this is to use the
#define isnan(x) std::isnan(x)
But I don't know anything about anything when it comes to this sort of thing
in C++ so I do not really know the "correct" way to do this. The ITK list is
settling on the std::isnan(x) convention. Not sure what track OpenSceneGraph
took.

The "correct C++" way of doing this is:

#include <cmath>

You can then refer to the isnan function as std::isnan within your code. Alternatively you can declare:

#include <cmath>
using namespace std;

...and then not have to qualify isnan with std::

Note that the above is not Apple specific.

Cheers,
-C

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.