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