Name

floor, floorf, floorl
- Returns the largest integral value not greater than argument

Library

libm.lib

Synopsis

  #include <math.h>
  double floor (double x);
  float floorf (float x);
  long double floorl (long double x);

Return values

x is integral or infinite, x itself is returned.


Detailed description

The floor, floorf, and floorl functions return the largest integral value less than or equal to x, expressed as a floating-point number.

Examples

#include <math.h>
int main( void )
{
   double y;
   y = floor( 2.8 );
   printf( "The floor of 2.8 is %f\n", y );
   y = floorf( 2.8 );
   printf( "The floorf of 2.8 is %f\n", y );
   y = floorl( 2.8 );
   printf( "The floorl of 2.8 is %f\n", y );
}

         

Output

The floor  of 2.8 is 2.000000
The floorf of 2.8 is 2.000000
The floorl of 2.8 is 2.000000

         


See also

abs, ceil, fabs, ieee, math, rint, round, trunc

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top