]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/remquo.3
encrypt.3: srcfix: rewrap source lines
[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 .\" %%%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 2017-09-15 "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 .in -4n
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
29 .in
30 .PP
31 .ad l
32 .BR remquo (),
33 .BR remquof (),
34 .BR remquol ():
35 .RS 4
36 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
37 .RE
38 .ad
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
47 pointer.
48 The remainder is returned as the function result.
49 .PP
50 The value of the remainder is the same as that computed by the
51 .BR remainder (3)
52 function.
53 .PP
54 The value stored via the
55 .I quo
56 pointer has the sign of
57 .IR "x\ /\ y"
58 and agrees with the quotient in at least the low order 3 bits.
59 .PP
60 For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2.
61 Note that the actual quotient might not fit in an integer.
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
67 .SH RETURN VALUE
68 On success, these functions return the same value as
69 the analogous functions described in
70 .BR remainder (3).
71 .PP
72 If
73 .I x
74 or
75 .I y
76 is a NaN, a NaN is returned.
77 .PP
78 If
79 .I x
80 is an infinity,
81 and
82 .I y
83 is not a NaN,
84 a domain error occurs, and
85 a NaN is returned.
86 .PP
87 If
88 .I y
89 is zero,
90 and
91 .I x
92 is not a NaN,
93 a domain error occurs, and
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
116 .SH VERSIONS
117 These functions first appeared in glibc in version 2.1.
118 .SH ATTRIBUTES
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{
127 .BR remquo (),
128 .BR remquof (),
129 .BR remquol ()
130 T} Thread safety MT-Safe
131 .TE
132 .SH CONFORMING TO
133 C99, POSIX.1-2001, POSIX.1-2008.
134 .SH SEE ALSO
135 .BR fmod (3),
136 .BR logb (3),
137 .BR remainder (3)