]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/remquo.3
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man3 / remquo.3
CommitLineData
a1eaacb1 1'\" t
fea681da 2.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
eb331ea6
MK
3.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4.\" <mtk.manpages@gmail.com>
2297bf0e 5.\"
95fb8859 6.\" SPDX-License-Identifier: GPL-1.0-or-later
a5e73dd4 7.\"
fea681da
MK
8.\" based on glibc infopages
9.\" polished, aeb
a5e73dd4 10.\"
4c1c5274 11.TH remquo 3 (date) "Linux man-pages (unreleased)"
fea681da 12.SH NAME
c13182ef 13remquo, remquof, remquol \- remainder and part of quotient
a32e2d10
AC
14.SH LIBRARY
15Math library
8fc3b2cf 16.RI ( libm ", " \-lm )
fea681da
MK
17.SH SYNOPSIS
18.nf
fea681da 19.B #include <math.h>
c6d039a3 20.P
fea681da 21.BI "double remquo(double " x ", double " y ", int *" quo );
fea681da 22.BI "float remquof(float " x ", float " y ", int *" quo );
fea681da 23.BI "long double remquol(long double " x ", long double " y ", int *" quo );
fea681da 24.fi
c6d039a3 25.P
d39ad78f 26.RS -4
cc4615cc
MK
27Feature Test Macro Requirements for glibc (see
28.BR feature_test_macros (7)):
d39ad78f 29.RE
c6d039a3 30.P
cc4615cc
MK
31.BR remquo (),
32.BR remquof (),
33.BR remquol ():
9d2adbae 34.nf
5c10d2c5 35 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
9d2adbae 36.fi
fea681da
MK
37.SH DESCRIPTION
38These functions compute the remainder and part of the quotient
39upon division of
40.I x
41by
42.IR y .
43A few bits of the quotient are stored via the
44.I quo
c13182ef 45pointer.
eb331ea6 46The remainder is returned as the function result.
c6d039a3 47.P
fea681da
MK
48The value of the remainder is the same as that computed by the
49.BR remainder (3)
50function.
c6d039a3 51.P
fea681da
MK
52The value stored via the
53.I quo
54pointer has the sign of
1ae6b2c7 55.I x\~/\~y
fea681da 56and agrees with the quotient in at least the low order 3 bits.
c6d039a3 57.P
646b2977 58For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2.
fea681da 59Note that the actual quotient might not fit in an integer.
fea681da
MK
60.\" A possible application of this function might be the computation
61.\" of sin(x). Compute remquo(x, pi/2, &quo) or so.
62.\"
63.\" glibc, UnixWare: return 3 bits
64.\" MacOS 10: return 7 bits
eb331ea6
MK
65.SH RETURN VALUE
66On success, these functions return the same value as
67the analogous functions described in
68.BR remainder (3).
c6d039a3 69.P
eb331ea6
MK
70If
71.I x
72or
73.I y
74is a NaN, a NaN is returned.
c6d039a3 75.P
eb331ea6
MK
76If
77.I x
78is an infinity,
79and
80.I y
81is not a NaN,
efe294cb 82a domain error occurs, and
eb331ea6 83a NaN is returned.
c6d039a3 84.P
eb331ea6
MK
85If
86.I y
87is zero,
88and
89.I x
90is not a NaN,
efe294cb 91a domain error occurs, and
eb331ea6
MK
92a NaN is returned.
93.SH ERRORS
94See
95.BR math_error (7)
96for information on how to determine whether an error has occurred
97when calling these functions.
c6d039a3 98.P
eb331ea6
MK
99The following errors can occur:
100.TP
101Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \
102and the other argument is not a NaN
103.\" .I errno
104.\" is set to
105.\" .BR EDOM .
106An invalid floating-point exception
107.RB ( FE_INVALID )
108is raised.
c6d039a3 109.P
eb331ea6
MK
110These functions do not set
111.IR errno .
112.\" FIXME . Is it intentional that these functions do not set errno?
fd00f831 113.\" Bug raised: https://www.sourceware.org/bugzilla/show_bug.cgi?id=6802
cf509809 114.SH ATTRIBUTES
f3635718
PH
115For an explanation of the terms used in this section, see
116.BR attributes (7).
117.TS
118allbox;
c466875e 119lbx lb lb
f3635718
PH
120l l l.
121Interface Attribute Value
122T{
9e54434e
BR
123.na
124.nh
cf509809
PH
125.BR remquo (),
126.BR remquof (),
cf509809 127.BR remquol ()
f3635718
PH
128T} Thread safety MT-Safe
129.TE
3113c7f3 130.SH STANDARDS
4131356c
AC
131C11, POSIX.1-2008.
132.SH HISTORY
133glibc 2.1.
134C99, POSIX.1-2001.
47297adb 135.SH SEE ALSO
fea681da
MK
136.BR fmod (3),
137.BR logb (3),
cc4615cc 138.BR remainder (3)