DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

isnan(S)


isnan, isnand, isnanf, finite, fpclass, unordered -- determine type of floating-point number

Syntax

cc . . . -lc

   

include <ieeefp.h>

int isnand (double dsrc);

int isnanf (float fsrc);

int finite (double dsrc);

fpclass_t fpclass (double dsrc);

int unordered (double dsrc1, double dsrc2);

include <math.h>

int isnan (double dsrc);

Description

isnan, isnand, and isnanf return true (1) if the argument dsrc or fsrc is NaN; otherwise they return false (0). The functionality of isnan is identical to that of isnand.

isnanf is implemented as a macro included in the ieeefp.h header file.

fpclass returns the class that dsrc belongs to. The 10 possible classes are as follows:


FP_SNAN
signaling NaN

FP_QNAN
quiet NaN

FP_NINF
negative infinity

FP_PINF
positive infinity

FP_NDENORM
negative denormalized non-zero

FP_PDENORM
positive denormalized non-zero

FP_NZERO
negative zero

FP_PZERO
positive zero

FP_NNORM
negative normalized non-zero

FP_PNORM
positive normalized non-zero

finite returns true (1) if the argument dsrc is neither infinity nor NaN; otherwise it returns false (0).

unordered returns true (1) if one of its two arguments is unordered with respect to the other argument. This is equivalent to reporting whether either argument is NaN. If neither of the arguments is NaN, false (0) is returned.

None of these routines generates exceptions, even for signaling NaNs.

See also

fpgetround(S)

Standards conformance

isnan is conformant with:

Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2) .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003