C examples for math.h:remainder
function
<cmath> <ctgmath> <math.h>
Returns the floating-point remainder of numer/denom (rounded to nearest):
remainder = numer - rquot * denom
Where rquot is the result of: numer/ denom, rounded toward the nearest integral value.
long double remainderl (long double numer, long double denom); long double remainder (long double numer, long double denom); double remainder (double numer , double denom); float remainderf (float numer , float denom); double remainder (Type1 numer , Type2 denom);
Parameter | Description |
---|---|
numer | Value of the quotient numerator. |
denom | Value of the quotient denominator. |
The remainder of dividing the arguments.
#include <stdio.h> #include <math.h> int main ()//from w w w .j av a 2s . c om { printf ( "%f\n", remainder (5,2) ); printf ( "%f\n", remainder (5.3,2) ); printf ( "%f\n", remainder (18.5,3.2) ); return 0; }