1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
7 .\" based on glibc infopages
10 .TH REMQUO 3 2021-03-22 "GNU" "Linux Programmer's Manual"
12 remquo, remquof, remquol \- remainder and part of quotient
15 .RI ( libm ", " \-lm )
20 .BI "double remquo(double " x ", double " y ", int *" quo );
21 .BI "float remquof(float " x ", float " y ", int *" quo );
22 .BI "long double remquol(long double " x ", long double " y ", int *" quo );
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
34 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
37 These functions compute the remainder and part of the quotient
42 A few bits of the quotient are stored via the
45 The remainder is returned as the function result.
47 The value of the remainder is the same as that computed by the
51 The value stored via the
53 pointer has the sign of
55 and agrees with the quotient in at least the low order 3 bits.
57 For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2.
58 Note that the actual quotient might not fit in an integer.
59 .\" A possible application of this function might be the computation
60 .\" of sin(x). Compute remquo(x, pi/2, &quo) or so.
62 .\" glibc, UnixWare: return 3 bits
63 .\" MacOS 10: return 7 bits
65 On success, these functions return the same value as
66 the analogous functions described in
73 is a NaN, a NaN is returned.
81 a domain error occurs, and
90 a domain error occurs, and
95 for information on how to determine whether an error has occurred
96 when calling these functions.
98 The following errors can occur:
100 Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \
101 and the other argument is not a NaN
105 An invalid floating-point exception
109 These functions do not set
111 .\" FIXME . Is it intentional that these functions do not set errno?
112 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6802
114 These functions first appeared in glibc in version 2.1.
116 For an explanation of the terms used in this section, see
124 Interface Attribute Value
129 T} Thread safety MT-Safe
135 C99, POSIX.1-2001, POSIX.1-2008.