Skybuck said:
What does the isnan routine do ?
Documentation says it checks for NaN ? What does that mean ?
As I understand it:
The IEEE 754-1985 standard defines ways of representing floating point
values as binary numbers. One bit-pattern called NaN ("not a number") is a
special case; it is used to represent values that don't have a valid
representation in the IEEE format (for example, square root of a negative
number).
Many (but not all) implementations of C abide by the IEEE standard for
representing floating point numbers.
The Single Unix Specification defines the C function isnan. You pass it a
double, and it tells you if the value is NaN (i.e., it returns a nonzero
value if the parameter is NaN, 0 if it is not). (For systems that have the
isnan function but don't support NaN values, isnan always returns 0.)
What is a good replacement for Visual C/C++ 6.0 ?
The Microsoft C library seems to have a function called _isnan (note the
leading underscore) that works like the Unix function isnan. However, it is
declared in the header <float.h> instead of <math.h>.
Anyway, that's my understanding. I'm not an expert on these issues. IEEE
754-1985, the Single Unix Specification, and Microsoft C implementation are
off-topic for this newsgroup. See the welcome message:
http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html
If you want more information, you'd be better off directing your queries to
another newsgroup.