isnormal


isnormal

Tests whether a given floating-point value is normalized

 #include <math.h> int isnormal ( float x  ); int isnormal ( double x  ); int isnormal ( long double x  ); 

The macro isnormal( ) yields a nonzero value (that is, TRue) if its argument's value is a normalized floating-point number. Otherwise, isnormal( ) yields 0. The argument must be a real floating-point type. The rule that floating-point types are promoted to at least double precision for mathematical calculations does not apply here; the argument's properties are determined based on its representation in its actual semantic type.

Example

 double maximum( double a, double b ) {   if ( isnormal( a ) && isnormal( b ) )    // Handle normal case first.     return ( a >= b ) ? a : b ;   else if ( isnan( a ) || isnan( b ) )   {     /* ... */ 

See Also

fpclassify( ), isfinite( ), isinf( ), isnan( ), signbit( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net