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