]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2 | .\" Distributed under GPL | |
3 | .\" based on glibc infopages | |
4 | .\" polished, aeb | |
cc4615cc | 5 | .TH REMQUO 3 2007-07-26 "GNU" "Linux Programmer's Manual" |
fea681da | 6 | .SH NAME |
c13182ef | 7 | remquo, remquof, remquol \- remainder and part of quotient |
fea681da MK |
8 | .SH SYNOPSIS |
9 | .nf | |
fea681da MK |
10 | .B #include <math.h> |
11 | .sp | |
12 | .BI "double remquo(double " x ", double " y ", int *" quo ); | |
d39541ec | 13 | .br |
fea681da | 14 | .BI "float remquof(float " x ", float " y ", int *" quo ); |
d39541ec | 15 | .br |
fea681da | 16 | .BI "long double remquol(long double " x ", long double " y ", int *" quo ); |
fea681da | 17 | .fi |
cc4615cc MK |
18 | .sp |
19 | Link with \fI\-lm\fP. | |
20 | .sp | |
21 | .in -4n | |
22 | Feature Test Macro Requirements for glibc (see | |
23 | .BR feature_test_macros (7)): | |
24 | .in | |
25 | .sp | |
26 | .ad l | |
27 | .BR remquo (), | |
28 | .BR remquof (), | |
29 | .BR remquol (): | |
30 | _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or | |
31 | .I cc\ -std=c99 | |
32 | .ad b | |
fea681da MK |
33 | .SH DESCRIPTION |
34 | These functions compute the remainder and part of the quotient | |
35 | upon division of | |
36 | .I x | |
37 | by | |
38 | .IR y . | |
39 | A few bits of the quotient are stored via the | |
40 | .I quo | |
c13182ef MK |
41 | pointer. |
42 | The remainder is returned as function value. | |
fea681da MK |
43 | |
44 | The value of the remainder is the same as that computed by the | |
45 | .BR remainder (3) | |
46 | function. | |
47 | ||
48 | The value stored via the | |
49 | .I quo | |
50 | pointer has the sign of | |
51 | .IR x / y | |
52 | and agrees with the quotient in at least the low order 3 bits. | |
53 | ||
54 | For example, remquo(29.0,3.0) returns \-1.0 and might store 2. | |
55 | Note that the actual quotient might not fit in an integer. | |
fea681da MK |
56 | .\" A possible application of this function might be the computation |
57 | .\" of sin(x). Compute remquo(x, pi/2, &quo) or so. | |
58 | .\" | |
59 | .\" glibc, UnixWare: return 3 bits | |
60 | .\" MacOS 10: return 7 bits | |
61 | .SH "CONFORMING TO" | |
62 | C99 | |
63 | .SH "SEE ALSO" | |
64 | .BR fmod (3), | |
65 | .BR logb (3), | |
cc4615cc | 66 | .BR remainder (3) |