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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <math.h>
    double fmod( double x, double y );

Description:
    The fmod function computes the floating-point remainder of x/y, even if
    the quotient x/y is not representable.

Returns:
    The fmod function returns the value x - (i * y), for some integer i such
    that, if y is non-zero, the result has the same sign as x and magnitude
    less than the magnitude of y.  If the value of y is zero, then the value
    returned is zero.

See Also:
    ceil, fabs, floor

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

    void main()
      {
        printf( "%f\n", fmod(  4.5,  2.0 ) );
        printf( "%f\n", fmod( -4.5,  2.0 ) );
        printf( "%f\n", fmod(  4.5, -2.0 ) );
        printf( "%f\n", fmod( -4.5, -2.0 ) );
      }

    produces the following:

    0.500000
    -0.500000
    0.500000
    -0.500000

Classification:
    ANSI

Systems:
    All

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