OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / remainder.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\"     <mtk.manpages@gmail.com>
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\"
30 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
31 .\" Modified 2002-08-10 Walter Harms
32 .\"     (walter.harms@informatik.uni-oldenburg.de)
33 .\" Modified 2003-11-18, 2004-10-05 aeb
34 .\"
35 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
36 .\" and Copyright (c) 2008 Akihiro MOTOKI
37 .\" Translated 2004-09-02, Yuichi SATO <ysato444@yahoo.co.jp>
38 .\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
39 .\" Modified 2005-02-26, Yuichi SATO <ysato444@yahoo.co.jp>
40 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
41 .\"
42 .TH REMAINDER 3 2009-02-04 "" "Linux Programmer's Manual"
43 .\"O .SH NAME
44 .SH Ì¾Á°
45 .\"O drem, dremf, dreml, remainder, remainderf, remainderl \- \
46 .\"O floating-point remainder function
47 drem, dremf, dreml, remainder, remainderf, remainderl \- ÉâÆ°¾®¿ôÅÀ¾ê;´Ø¿ô
48 .\"O .SH SYNOPSIS
49 .SH ½ñ¼°
50 .nf
51 .B #include <math.h>
52 .sp
53 .\"O /* The C99 versions */
54 /* C99 ÈÇ */
55 .BI "double remainder(double " x ", double " y );
56 .BI "float remainderf(float " x ", float " y );
57 .BI "long double remainderl(long double " x ", long double " y );
58 .sp
59 .\"O /* Obsolete synonyms */
60 /* Çѻߤµ¤ì¤¿ÊÌ̾ */
61 .BI "double drem(double " x ", double " y );
62 .BI "float dremf(float " x ", float " y );
63 .BI "long double dreml(long double " x ", long double " y );
64 .sp
65 .fi
66 .\"O Link with \fI\-lm\fP.
67 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
68 .sp
69 .in -4n
70 .\"O Feature Test Macro Requirements for glibc (see
71 .\"O .BR feature_test_macros (7)):
72 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
73 .RB ( feature_test_macros (7)
74 »²¾È):
75 .in
76 .sp
77 .ad l
78 .BR remainder ():
79 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or
80 .I cc\ -std=c99
81 .br
82 .BR remainderf (),
83 .BR remainderl ():
84 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
85 .I cc\ -std=c99
86 .br
87 .BR drem (),
88 .BR dremf (),
89 .BR dreml ():
90 _SVID_SOURCE || _BSD_SOURCE
91 .ad b
92 .\"O .SH DESCRIPTION
93 .SH ÀâÌÀ
94 .\"O The
95 .\"O .BR remainder ()
96 .\"O function computes the remainder of dividing
97 .\"O .I x
98 .\"O by
99 .\"O .IR y .
100 .BR remainder ()
101 ´Ø¿ô¤Ï
102 .I x
103 ¤ò
104 .I y
105 ¤Ç³ä¤Ã¤¿Í¾¤ê¤ò·×»»¤¹¤ë¡£
106 .\"O The return value is
107 .\"O \fIx\fP\-\fIn\fP*\fIy\fP,
108 .\"O where
109 .\"O .I n
110 .\"O is the value
111 .\"O .IR "x\ /\ y" ,
112 .\"O rounded to the nearest integer.
113 ÊÖ¤êÃͤÏ
114 \fIx\fP\-\fIn\fP*\fIy\fP
115 ¤Ç¤¢¤ë¡£
116 ¤³¤³¤Ç
117 .I n
118 ¤Ï
119 .I "x\ /\ y"
120 ¤ÎÃͤòºÇ¤â¶á¤¤À°¿ô¤Ë´Ý¤á¤¿¤â¤Î¤Ç¤¢¤ë¡£
121 .\"O If the absolute value of
122 .\"O \fIx\fP\-\fIn\fP*\fIy\fP
123 .\"O is 0.5,
124 .\"O .I n
125 .\"O is chosen to be even.
126 \fIx\fP\-\fIn\fP*\fIy\fP
127 ¤ÎÀäÂÐÃͤ¬ 0.5 ¤Î¾ì¹ç¡¢¶ö¿ô¤Ë¤Ê¤ë¤è¤¦¤Ë
128 .I n
129 ¤¬Áª¤Ð¤ì¤ë¡£
130
131 .\"O These functions are unaffected by the current rounding mode (see
132 .\"O .BR fenv (3)).
133 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¸½ºß¤Î´Ý¤á¥â¡¼¥É¤Î±Æ¶Á¤ò¼õ¤±¤Ê¤¤ (´Ý¤á¥â¡¼¥É¤Ë¤Ä¤¤¤Æ¤Ï
134 .BR fenv (3)
135 ¤ò»²¾È)¡£
136 .LP
137 .\"O The
138 .\"O .BR drem ()
139 .\"O function does precisely the same thing.
140 .BR drem ()
141 ´Ø¿ô¤Ï¤³¤ì¤ÈÁ´¤¯Æ±¤¸Æ°ºî¤ò¤¹¤ë¡£
142 .\"O .SH "RETURN VALUE"
143 .SH ÊÖ¤êÃÍ
144 .\"O On success, these
145 .\"O functions return the floating-point remainder,
146 .\"O \fIx\fP\-\fIn\fP*\fIy\fP.
147 .\"O If the return value is 0, it has the sign of
148 .\"O .IR x .
149 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÏÉâÆ°¾®¿ôÅÀ¤Î¾ê; \fIx\fP\-\fIn\fP*\fIy\fP ¤òÊÖ¤¹¡£
150 ÊÖ¤êÃͤ¬ 0 ¤Î¾ì¹ç¡¢¤½¤ÎÉä¹æ¤Ï
151 .I x
152 ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£
153
154 .\"O If
155 .\"O .I x
156 .\"O or
157 .\"O .I y
158 .\"O is a NaN, a NaN is returned.
159 .I x
160 ¤«
161 .I y
162 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
163
164 .\"O If
165 .\"O .I x
166 .\"O is an infinity,
167 .\"O and
168 .\"O .I y
169 .\"O is not a NaN,
170 .\"O a domain error occurs, and
171 .\"O a NaN is returned.
172 .I x
173 ¤¬Ìµ¸ÂÂç¤Ç
174 .I y
175 ¤¬ NaN ¤Ç¤Ê¤¤¾ì¹ç¡¢
176 Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
177
178 .\"O If
179 .\"O .I y
180 .\"O is zero,
181 .\" FIXME . Instead, glibc gives a domain error even if x is a NaN
182 .\"O and
183 .\"O .I x
184 .\"O is not a NaN,
185 .\" Interestingly, remquo(3) does not have the same problem.
186 .\"O a domain error occurs, and
187 .\"O a NaN is returned.
188 .I y
189 ¤¬¥¼¥í¤Ç
190 .I x
191 ¤¬ NaN ¤Ç¤Ê¤¤¾ì¹ç¡¢
192 Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
193 .\"O .SH ERRORS
194 .SH ¥¨¥é¡¼
195 .\"O See
196 .\"O .BR math_error (7)
197 .\"O for information on how to determine whether an error has occurred
198 .\"O when calling these functions.
199 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
200 .BR math_error (7)
201 ¤ò»²¾È¤Î¤³¤È¡£
202 .PP
203 .\"O The following errors can occur:
204 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
205 .TP
206 .\"O Domain error: \fIx\fP is an infinity and \fIy\fP is not a NaN
207 Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬Ìµ¸ÂÂç¤Ç \fIy\fP ¤¬ NaN ¤Ç¤Ï¤Ê¤¤
208 .\" .I errno
209 .\" is set to
210 .\" .BR EDOM .
211 .\"O An invalid floating-point exception
212 .\"O .RB ( FE_INVALID )
213 .\"O is raised.
214 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
215 .RB ( FE_INVALID )
216 ¤¬¾å¤¬¤ë¡£
217 .IP
218 .\"O These functions do not set
219 .\"O .IR errno
220 .\"O for this case.
221 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾ì¹ç¤Ë
222 .I errno
223 ¤òÀßÄꤷ¤Ê¤¤¡£
224 .\" FIXME . Is it intentional that these functions do not set errno?
225 .\" They do set errno for the y == 0 case, below.
226 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6783
227 .TP
228 .\"O Domain error: \fIy\fP is zero\" [XXX see bug above] and \fIx\fP is not a NaN
229 Îΰ襨¥é¡¼: \fIy\fP ¤¬¥¼¥í¤Ç \fIx\fP ¤¬ NaN ¤Ç¤Ï¤Ê¤¤ (²¼µ­¤Î¡Ö¥Ð¥°¡×»²¾È)
230 .\"O .I errno
231 .\"O is set to
232 .\"O .BR EDOM .
233 .\"O An invalid floating-point exception
234 .\"O .RB ( FE_INVALID )
235 .\"O is raised.
236 .I errno
237 ¤Ë
238 .B EDOM
239 ¤¬ÀßÄꤵ¤ì¤ë¡£
240 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
241 .RB ( FE_INVALID )
242 ¤¬¾å¤¬¤ë¡£
243 .\"O .SH "CONFORMING TO"
244 .SH ½àµò
245 .\" IEC 60559.
246 .\"O The functions
247 .\"O .BR remainder (),
248 .\"O .BR remainderf (),
249 .\"O and
250 .\"O .BR remainderl ()
251 .\"O are specified in C99 and POSIX.1-2001.
252 ´Ø¿ô
253 .BR remainder (),
254 .BR remainderf (),
255 .BR remainderl ()
256 ¤Ï C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
257
258 .\"O The function
259 .\"O .BR drem ()
260 .\"O is from 4.3BSD.
261 .\"O The
262 .\"O .I float
263 .\"O and
264 .\"O .I "long double"
265 .\"O variants
266 .\"O .BR dremf ()
267 .\"O and
268 .\"O .BR dreml ()
269 .\"O exist on some systems, such as Tru64 and glibc2.
270 .\"O Avoid the use of these functions in favor of
271 .\"O .BR remainder ()
272 .\"O etc.
273 ´Ø¿ô
274 .BR drem ()
275 ¤Ï 4.3BSD ¤ËͳÍ褹¤ë¡£
276 .I float
277 ¤È
278 .I "long double"
279 ÈǤÎ
280 .BR dremf ()
281 ¤È
282 .BR dreml ()
283 ¤Ï¡¢Tru64 ¤ä glibc2 ¤Î¤è¤¦¤Ê¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£
284 ¤³¤ì¤é¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¤Æ¡¢
285 .BR remainder ()
286 ¤Ê¤É¤ò»ÈÍѤ¹¤ë¤³¤È¡£
287 .\"O .SH BUGS
288 .SH ¥Ð¥°
289 .\"O The call
290 .\"O 
291 .\"O     remainder(nan(""), 0);
292 .\"O 
293 .\"O returns a NaN, as expected, but wrongly causes a domain error;
294 .\"O it should yield a silent NaN.
295
296     remainder(nan(""), 0);
297
298 ¤Î¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦¤È¡¢´üÂÔÄ̤ê Nan ¤¬Ê֤뤬¡¢¸í¤Ã¤ÆÎΰ襨¥é¡¼¤¬È¯À¸¤¹¤ë¡£
299 Àµ¤·¤¯¤Ï¥¨¥é¡¼¤Ê¤·¤Î Nan ¤È¤Ê¤ë¤Ù¤­¤Ç¤¢¤ë¡£
300 .\" FIXME . this bug occurs as at glibc 2.8.
301 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6779
302 .\"O .SH EXAMPLE
303 .SH Îã
304 .\"O The call "remainder(29.0, 3.0)" returns \-1.
305 "remainder(29.0, 3.0)" ¤ò¸Æ¤Ó½Ð¤¹¤È \-1 ¤òÊÖ¤¹¡£
306 .\"O .SH "SEE ALSO"
307 .SH ´ØÏ¢¹àÌÜ
308 .BR div (3),
309 .BR fmod (3),
310 .BR remquo (3)