On Mittwoch, 3. März 2004 04:51, Curtis L. Olson wrote:
> In Linux isnan() is defined in math.h.  Is this a portable function (errr
> macro) available to everyone?

I do not remember which standard isnan is according to. I know that SunOS 5.4 
and HP-UX 9, all systems from about 4 years ago or older, already had the 
isnan function.

But there is an alternative you can use

#define isnan(x) ((x) != (x))

The standard covering floatingpoint arithmetics, IEEE754 requires that this is 
equivalent.
Some compilers may optimize such things away with a true value when they are 
allowed to violate IEEE754 via compiler flags. I can imaginge that gcc's 
-mno-ieee-fp flag does things like that.
For that case create a single small c file containing only this small 
function. Compile this one without optimizations and use it ...

    Greetings

       Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to