Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <stdlib.h> div_t div(int dividend, int divisor);
The remainder is expressed by the equation: Quotient * Divisor + Remainder = Dividend | |
Return val. | Structure of type | |
| containing both the quotient quot and the remainder rem as | |
Example | div_t d; d = div( 7, 3); /* d.quot = 2, d.rem = 1 */ d = div(-7, 3); /* d.quot = -2, d.rem = -1 */ d = div( 7,-3); /* d.quot = -2, d.rem = 1 */ d = div(-7,-3); /* d.quot = 2, d.rem = -1 */ | |
See also | ldiv, lldiv |