Performs the modulo operation #include <math.h> double The , called "y modulo x." The remainder is equal to y minus the product of x and the largest integer quotient whose absolute value is not greater than that of y. This quotient is negative (or 0) if y and x have opposite signs, and the return value has the same sign as y. If the argument x is zero, yfmod( ) may incur a domain error, or return 0.## Exampledouble people = -2.25, apples = 3.3, eachgets = 0.0, someleft = 0.0; int saverounding = fegetround( ); // Save previous setting fesetround(FE_TOWARDZERO); eachgets = rint( apples / people ); someleft = This code produces the following output: If there are -2.25 of us and +3.30 apples, each of us gets -1.00, with +1.05 left over. ## See AlsoThe C99 functions |