isnan

Hi,

I am trying to use isnan function under QNX 6.2.0. Eventhought I have
included <math.h>, compiler gaves me the error of "implicit declation of
function ‘int isnan(…)’.
Anyone knows the reason?

Thank you,

Mustafa Yavas

Mustafa wrote:

Hi,

I am trying to use isnan function under QNX 6.2.0. Eventhought I have
included <math.h>, compiler gaves me the error of "implicit declation of
function ‘int isnan(…)’.
Anyone knows the reason?

Thank you,

Mustafa Yavas

There are some serious problems with NANs in QNX 6.2.1
For one thing, there’s a #define in <math.h> that defined
NAN as (1.0/1.0), which is just wrong.
This apparently resulted in some of the trig functions
returning 1 when they should have returned NaN. I understand
this was fixed in QNX 6.3

However, “isnan” is defined in math.h, and should work.
Are you compiling C or C++?

Using “finite” has some advantages. “finite” is true
only for proper numeric values. “isnan” only tests for
“NaN” values. For “INF” (which is what you get when
you divide by zero), “finite” and “isnan” are both false.

John Nagle