Amiga Unix — 68040 · 68060

Manual pages › C library (3C)

isnan(3C)

determine type of floating-point number

From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.

NAME

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

SYNOPSIS

#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 a NaN; otherwise they return false (0). The functionalty 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 the dsrc belongs to.  The 10  pos-
sible 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 generate any exception, even for signaling NaNs.

SEE ALSO

fpgetround(3C), intro(3M).