> ~ Online tutorial

fmod()

 Calculates x modulo y, the remainder of x/y

 Declaration:

double fmod(double x, double y);
 long double fmod(long double (x), long double (y));

 Remarks:

fmod and fmodl calculate x modulo y. This is defined as the remainder f,
where

  x = (ay + f) for some integer a

and

  0 < f < y.

 Return Value:


 Where  x = ay + f  and  0 < f < y,
    fmod and fmodl return the remainder f.
 Where  y = 0, fmod and fmodl return 0.

 Example:

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

 int main(void)
 {
    double x = 5.0, y = 2.0;
    double result;

    result = fmod(x,y);
    printf("The remainder of (%lf / %lf) is %lf\n", x, y, result);
    return 0;
 }

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: