Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <math.h>
    double floor( double x );

Description:
    The floor function computes the largest integer not greater than x.

Returns:
    The floor function computes the largest integer not greater than x,
    expressed as a double.

Example:
    #include <stdio.h>
    #include <math.h>

    void main()
      {
        printf( "%f\n", floor( -3.14 ) );
        printf( "%f\n", floor( -3. ) );
        printf( "%f\n", floor( 0. ) );
        printf( "%f\n", floor( 3.14 ) );
        printf( "%f\n", floor( 3. ) );
      }

    produces the following:

    -4.000000
    -3.000000
    0.000000
    3.000000
    3.000000

Classification:
    ANSI

Systems:
    Math

See Also:
    ceil, fmod

See Also: ceil fmod

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson