div_t(3type)

div_t3type

Quotient and remainder of an integer division

Usage

#include <stdlib.h>

typedef struct { int quot; /* Quotient */ int rem; /* Remainder */ } div_t;

typedef struct { long quot; /* Quotient */ long rem; /* Remainder */ } ldiv_t;

typedef struct { long long quot; /* Quotient */ long long rem; /* Remainder */ } lldiv_t;

#include <inttypes.h>

typedef struct { intmax_t quot; /* Quotient */ intmax_t rem; /* Remainder */ } imaxdiv_t;

Library

Standard C library (libc)

Overview

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

Releases

3 releases since Debian 12 (Bookworm); the text changed 2 times.

  1. 12
  2. 13
  3. Arch

Standards

C11, POSIX.1-2024.

History

div_tldiv_t

SUSv1, C99, POSIX.1-2001.

lldiv_timaxdiv_t

C99, POSIX.1-2001.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.