]>
Commit | Line | Data |
---|---|---|
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 | 14 | remquo, 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 | 26 | Link with \fI\-lm\fP. |
68e4db0a | 27 | .PP |
cc4615cc MK |
28 | .in -4n |
29 | Feature 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 |
42 | These functions compute the remainder and part of the quotient | |
43 | upon division of | |
44 | .I x | |
45 | by | |
46 | .IR y . | |
47 | A few bits of the quotient are stored via the | |
48 | .I quo | |
c13182ef | 49 | pointer. |
eb331ea6 | 50 | The remainder is returned as the function result. |
847e0d88 | 51 | .PP |
fea681da MK |
52 | The value of the remainder is the same as that computed by the |
53 | .BR remainder (3) | |
54 | function. | |
847e0d88 | 55 | .PP |
fea681da MK |
56 | The value stored via the |
57 | .I quo | |
58 | pointer has the sign of | |
646b2977 | 59 | .IR "x\ /\ y" |
fea681da | 60 | and agrees with the quotient in at least the low order 3 bits. |
847e0d88 | 61 | .PP |
646b2977 | 62 | For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2. |
fea681da | 63 | Note 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 |
70 | On success, these functions return the same value as | |
71 | the analogous functions described in | |
72 | .BR remainder (3). | |
847e0d88 | 73 | .PP |
eb331ea6 MK |
74 | If |
75 | .I x | |
76 | or | |
77 | .I y | |
78 | is a NaN, a NaN is returned. | |
847e0d88 | 79 | .PP |
eb331ea6 MK |
80 | If |
81 | .I x | |
82 | is an infinity, | |
83 | and | |
84 | .I y | |
85 | is not a NaN, | |
efe294cb | 86 | a domain error occurs, and |
eb331ea6 | 87 | a NaN is returned. |
847e0d88 | 88 | .PP |
eb331ea6 MK |
89 | If |
90 | .I y | |
91 | is zero, | |
92 | and | |
93 | .I x | |
94 | is not a NaN, | |
efe294cb | 95 | a domain error occurs, and |
eb331ea6 MK |
96 | a NaN is returned. |
97 | .SH ERRORS | |
98 | See | |
99 | .BR math_error (7) | |
100 | for information on how to determine whether an error has occurred | |
101 | when calling these functions. | |
102 | .PP | |
103 | The following errors can occur: | |
104 | .TP | |
105 | Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \ | |
106 | and the other argument is not a NaN | |
107 | .\" .I errno | |
108 | .\" is set to | |
109 | .\" .BR EDOM . | |
110 | An invalid floating-point exception | |
111 | .RB ( FE_INVALID ) | |
112 | is raised. | |
113 | .PP | |
114 | These 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 |
119 | These functions first appeared in glibc in version 2.1. | |
cf509809 | 120 | .SH ATTRIBUTES |
f3635718 PH |
121 | For an explanation of the terms used in this section, see |
122 | .BR attributes (7). | |
123 | .TS | |
124 | allbox; | |
125 | lbw30 lb lb | |
126 | l l l. | |
127 | Interface Attribute Value | |
128 | T{ | |
cf509809 PH |
129 | .BR remquo (), |
130 | .BR remquof (), | |
cf509809 | 131 | .BR remquol () |
f3635718 PH |
132 | T} Thread safety MT-Safe |
133 | .TE | |
47297adb | 134 | .SH CONFORMING TO |
9a74e018 | 135 | C99, 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) |