Name

finite, finitef, finitel
- test for infinity or not-a-number (NaN)

Library

libm.lib

Synopsis

  #include <math.h>
  double finite (double x);
  float finitef (float x);
  long double finitel (long double x);

Detailed description

The finite finitef and finitel functions return a non-zero value if value is neither infinite nor a "not-a-number" (NaN) value, and 0 otherwise.

Examples

#include <math.h>
int main( void )
{
   double x;
   int y; 
   x = 1.34565;
   y = finite( x );
   printf( "finite( %f ) =  %d\n", x, y );
   y = finitef( x );
   printf( "finitef( %f ) = %d\n",x, y );
   y = finitel( x );
   printf( "finitel( %f ) = %d\n",x, y );
}

         

Output

finite ( 1.34565 ) = 1
finitef( 1.34565 ) = 1
finitel( 1.34565 ) =

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top