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