div()

NAME

div() - return quotient and remainder from division

SYNOPSIS

#include <stdlib.h>

div_t div (int num, int denom)

DESCRIPTION

The div(3) function computes the value num and returns the quotient and remainder in a structure named div_t that contains two int members named quot and rem. If your application requires numbers to be rounded in the same way on all systems, use

div(a,b).quot
instead of
a/b
To get the remainder, use
div(a,b).rem

SEE ALSO

ldiv(3)