---
name: "div"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/div"
---

# div(3)

return quotient and remainder from division

## NAME

**div** – return quotient and remainder from division

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<stdlib.h\>**

*div\_t*\

**div**(*int numer*, *int denom*);

## DESCRIPTION

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).

## SEE ALSO

[imaxdiv(3)](/imaxdiv/3.md), [ldiv(3)](/ldiv/3.md), [lldiv(3)](/lldiv/3.md)

## STANDARDS

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