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