No need to have 4 separate manpages for these functions.
Sponsored by: Klara, Inc.
(will commit the small change in share/man/man3/stdckdint.3 separately)
Differential D55360
libc: Roll {l,ll,imax}div(3) manpages into just div(3) Authored by obiwac on Feb 18 2026, 11:25 PM. Tags None Referenced Files
Details No need to have 4 separate manpages for these functions. Sponsored by: Klara, Inc. (will commit the small change in share/man/man3/stdckdint.3 separately) Rendered version of manpage: DIV(3) FreeBSD Library Functions Manual DIV(3)
NAME
div, ldiv, lldiv, imaxdiv – return quotient and remainder from division
SYNOPSIS
/* -lc */
#include <stdlib.h>
div_t
div(int numer, int denom);
ldiv_t
ldiv(long numer, long denom);
lldiv_t
lldiv(long long numer, long long denom);
#include <inttypes.h>
imaxdiv_t
imaxdiv(intmax_t numer, intmax_t denom);
DESCRIPTION
The div(), ldiv(), lldiv(), and imaxdiv() functions compute the value of
numer (the numerator) divided by denom (the denominator) and return the
stored result in the form of the div_t, ldiv_t, lldiv_t, or imaxdiv_t
types, respectively. These types are structs which contain two int, long,
long long, or intmax_t members named quot (the quotient) and rem (the
remainder).
STANDARDS
The div(), ldiv(), lldiv(), and imaxdiv() functions conform to ISO/IEC
9899:2024 (“ISO C23”) and IEEE Std 1003.1-2024 (“POSIX.1”).
HISTORY
The div() and ldiv() functions first appeared in 4.3BSD. The lldiv() and
imaxdiv() functions first appeared in FreeBSD 5.0.
FreeBSD 16.0-CURRENT February 18, 2026 DIV(3)
Diff Detail
Event Timeline
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||