Implementation status: to be implemented


#include <stdlib.h>

div_t div(int numer, int denom);


The function divides numer (numerator) by denom (denominator).

The returned structure includes the following members, in any order:

int quot; /* quotient */
int rem; /* remainder */

If the result cannot be represented, the behavior is undefined; otherwise, quot* denom+ rem equals numer.

Return value

The function returns a structure of type div_t, comprising both the quotient and the remainder.


No errors are defined.