Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Standard C Library Functionsisnan(3C)


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

 

The isnan() function is identical to the isnand() function.

The isnanf() function is implemented as a macro included in the <ieeefp.h> header.

The fpclass() function returns one of the following classes to which dsrc belongs:

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

None of these routines generates an exception, even for signaling NaNs.

RETURN VALUES

 

The isnan(), isnand(), and isnanf() function return TRUE (1) if the argument dsrc or fsrc is a NaN; otherwise they return FALSE (0).

The finite() function returns TRUE (1) if the argument dsrc is neither infinity nor NaN; otherwise it returns FALSE (0).

The unordered() function 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 argument is NaN, FALSE (0) is returned.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

fpgetround(3C), attributes(5)


SunOS 5.9Go To TopLast Changed 29 Dec 1996

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.