—
NAME
div_t, ldiv_t, lldiv_t, imaxdiv_t - quotient and remainder of an integer division
LIBRARY
Standard C library (libc)
SYNOPSIS
bash
#include <stdlib.h>bash
typedef struct {\n
\n int quot;\n /* Quotient */
\n int rem;\n /* Remainder */
\n} div_t;bash
typedef struct {\n
\n long quot;\n /* Quotient */
\n long rem;\n /* Remainder */
\n} ldiv_t;bash
typedef struct {\n
\n long long quot;\n /* Quotient */
\n long long rem;\n /* Remainder */
\n} lldiv_t;bash
#include <inttypes.h>bash
typedef struct {\n
\n intmax_t quot;\n /* Quotient */
\n intmax_t rem;\n /* Remainder */
\n} imaxdiv_t;\nDESCRIPTION
[[l]l]div_t is the type of the value returned by the [[l]l]div(3) function.
imaxdiv_t is the type of the value returned by the imaxdiv(3) function.
STANDARDS
C11, POSIX.1-2008.
HISTORY
C99, POSIX.1-2001.
SEE ALSO
div(3), imaxdiv(3), ldiv(3), lldiv(3)