DESCRIPTION

The
div()
function computes the value
numerator/denominator and
returns the quotient and remainder in a structure
named div_t that contains
two integer members (in unspecified order) named quot and rem.
The quotient is rounded toward zero.
The result satisfies quot*denominator+rem = numerator.

The
ldiv(),
lldiv(),
and
imaxdiv()
functions do the same,
dividing numbers of the indicated type and
returning the result in a structure
of the indicated name, in all cases with fields quot and rem
of the same type as the function arguments.

RETURN VALUE

The div_t (etc.) structure.

ATTRIBUTES

For an explanation of the terms used in this section, see
attributes(7).

EXAMPLE

SEE ALSO

COLOPHON

This page is part of release 4.13 of the Linux
man-pages
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
https://www.kernel.org/doc/man-pages/.