div(3)

div3

Return quotient and remainder from division

Usage

#include <stdlib.h>

div_t

div(int numer, int denom);

Library

Standard C Library (libc, -lc)

Overview

The div() 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).

Releases

163 releases since Mac OS X 10.0; the text changed 4 times.

  1. 10.0–10.1.5
  2. 10.2–10.2.8
  3. 10.3–10.4.11
  4. 10.5–10.6.8
  5. 10.7–26.5

Standards

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

From Libc 1752.120.2 in macOS 26.5. Parsed by carta from the page's mdoc source.