summaryrefslogtreecommitdiffstats
path: root/man/man3type/div_t.3type
blob: 7abbb7616cf14f5d7795fd4ee223946e635dfa8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\" Copyright (c) 2020-2022 by Alejandro Colomar <alx@kernel.org>
.\" and Copyright (c) 2020 by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.\"
.TH div_t 3type (date) "Linux man-pages (unreleased)"
.SH NAME
div_t, ldiv_t, lldiv_t, imaxdiv_t \-
quotient and remainder of an integer division
.SH LIBRARY
Standard C library
.RI ( libc )
.SH SYNOPSIS
.EX
.B #include <stdlib.h>
.P
.B typedef struct {
.BR "    int quot;" " /* Quotient */"
.BR "    int rem;" "  /* Remainder */"
.B } div_t;
.P
.B typedef struct {
.BR "    long quot;" " /* Quotient */"
.BR "    long rem;" "  /* Remainder */"
.B } ldiv_t;
.P
.B typedef struct {
.BR "    long long quot;" " /* Quotient */"
.BR "    long long rem;" "  /* Remainder */"
.B } lldiv_t;
.P
.B #include <inttypes.h>
.P
.B typedef struct {
.BR "    intmax_t quot;" " /* Quotient */"
.BR "    intmax_t rem;" "  /* Remainder */"
.B } imaxdiv_t;
.EE
.SH DESCRIPTION
.RI [[ l ] l ] div_t
is the type of the value returned by the
.RB [[ l ] l ]\c
.BR div (3)
function.
.P
.I imaxdiv_t
is the type of the value returned by the
.BR imaxdiv (3)
function.
.SH STANDARDS
C11, POSIX.1-2008.
.SH HISTORY
C99, POSIX.1-2001.
.SH SEE ALSO
.BR div (3),
.BR imaxdiv (3),
.BR ldiv (3),
.BR lldiv (3)