OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / 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 2014-05-10 "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 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
39 _POSIX_C_SOURCE\ >=\ 200112L;
40 .br
41 or
42 .I cc\ -std=c99
43 .RE
44 .ad
45 .SH DESCRIPTION
46 These functions compute the remainder and part of the quotient
47 upon division of
48 .I x
49 by
50 .IR y .
51 A few bits of the quotient are stored via the
52 .I quo
53 pointer.
54 The remainder is returned as the function result.
55
56 The value of the remainder is the same as that computed by the
57 .BR remainder (3)
58 function.
59
60 The value stored via the
61 .I quo
62 pointer has the sign of
63 .IR "x\ /\ y"
64 and agrees with the quotient in at least the low order 3 bits.
65
66 For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2.
67 Note that the actual quotient might not fit in an integer.
68 .\" A possible application of this function might be the computation
69 .\" of sin(x). Compute remquo(x, pi/2, &quo) or so.
70 .\"
71 .\" glibc, UnixWare: return 3 bits
72 .\" MacOS 10: return 7 bits
73 .SH RETURN VALUE
74 On success, these functions return the same value as
75 the analogous functions described in
76 .BR remainder (3).
77
78 If
79 .I x
80 or
81 .I y
82 is a NaN, a NaN is returned.
83
84 If
85 .I x
86 is an infinity,
87 and
88 .I y
89 is not a NaN,
90 a domain error occurs, and
91 a NaN is returned.
92
93 If
94 .I y
95 is zero,
96 and
97 .I x
98 is not a NaN,
99 a domain error occurs, and
100 a NaN is returned.
101 .SH ERRORS
102 See
103 .BR math_error (7)
104 for information on how to determine whether an error has occurred
105 when calling these functions.
106 .PP
107 The following errors can occur:
108 .TP
109 Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \
110 and the other argument is not a NaN
111 .\" .I errno
112 .\" is set to
113 .\" .BR EDOM .
114 An invalid floating-point exception
115 .RB ( FE_INVALID )
116 is raised.
117 .PP
118 These functions do not set
119 .IR errno .
120 .\" FIXME . Is it intentional that these functions do not set errno?
121 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6802
122 .SH VERSIONS
123 These functions first appeared in glibc in version 2.1.
124 .SH ATTRIBUTES
125 .SS Multithreading (see pthreads(7))
126 The
127 .BR remquo (),
128 .BR remquof (),
129 and
130 .BR remquol ()
131 functions are thread-safe.
132 .SH CONFORMING TO
133 C99, POSIX.1-2001.
134 .SH SEE ALSO
135 .BR fmod (3),
136 .BR logb (3),
137 .BR remainder (3)
138 .SH COLOPHON
139 This page is part of release 3.68 of the Linux
140 .I man-pages
141 project.
142 A description of the project,
143 information about reporting bugs,
144 and the latest version of this page,
145 can be found at
146 \%http://www.kernel.org/doc/man\-pages/.