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