Parameters
- numerator
- Numerator.
- denom
- Denominator.
Return Value
The result is returned by value in a structure defined in <cstdlib>, which has two members. For div_t, these are, in either order:int quot; int rem;
and for ldiv_t:
long quot; long rem;
Portability
In C, only the int version exists.Example
| 1 2 3 4 5 6 7 8 9 10 11 |
|
Output:
38 div 5 => 7, remainder 3. |
See also
| ldiv | Integral division (function) |
