DIV(3) Library Functions Manual DIV(3)

divreturn quotient and remainder from division

Standard C Library (libc, -lc)

#include <stdlib.h>

div_t
div(int numer, int denom);

The () function computes the value numer/denom (numerator/denominator). It returns a structure named div_t that contains two int members named quot (quotient) and rem (remainder).

imaxdiv(3), ldiv(3), lldiv(3)

The div() function conforms to ISO/IEC 9899:1999 (“ISO C99”).

November 14, 2001 macOS 15.0