OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / fmod.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 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 2002-07-27 by Walter Harms
31 .\"     (walter.harms@informatik.uni-oldenburg.de)
32 .\"
33 .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
34 .\" and Copyright (c) 2008 Akihiro MOTOKI
35 .\" Translated Mon Jan 20 18:39:17 JST 1997
36 .\"       by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
37 .\" Updated Wed Oct 15 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
38 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
39 .\"
40 .\" WORD:  remainder function ¾ê;´Ø¿ô
41 .\"
42 .TH FMOD 3  2008-08-05 "" "Linux Programmer's Manual"
43 .\"O .SH NAME
44 .SH Ì¾Á°
45 .\"O fmod, fmodf, fmodl \- floating-point remainder function
46 fmod, fmodf, fmodl \- ÉâÆ°¾®¿ôÅÀ¾ê;´Ø¿ô
47 .\"O .SH SYNOPSIS
48 .SH ½ñ¼°
49 .nf
50 .B #include <math.h>
51 .sp
52 .BI "double fmod(double " x ", double " y );
53 .br
54 .BI "float fmodf(float " x ", float " y );
55 .br
56 .BI "long double fmodl(long double " x ", long double " y );
57 .fi
58 .sp
59 .\"O Link with \fI\-lm\fP.
60 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
61 .sp
62 .in -4n
63 .\"O Feature Test Macro Requirements for glibc (see
64 .\"O .BR feature_test_macros (7)):
65 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
66 .RB ( feature_test_macros (7)
67 »²¾È):
68 .in
69 .sp
70 .ad l
71 .BR fmodf (),
72 .BR fmodl ():
73 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
74 .I cc\ -std=c99
75 .ad b
76 .\"O .SH DESCRIPTION
77 .SH ÀâÌÀ
78 .\"O The
79 .\"O .BR fmod ()
80 .\"O function computes the floating-point remainder of dividing \fIx\fP by
81 .\"O \fIy\fP.
82 .\"O The return value is \fIx\fP \- \fIn\fP * \fIy\fP, where \fIn\fP
83 .\"O is the quotient of \fIx\fP / \fIy\fP, rounded towards zero to an integer.
84 .BR fmod ()
85 ´Ø¿ô¤Ï \fIx\fP ¤ò \fIy\fP ¤Ç³ä¤Ã¤¿ÉâÆ°¾®¿ôÅÀ¾ê;¤ò·×»»¤¹¤ë¡£
86 ÊÖ¤êÃͤϠ\fIx\fP \- \fIn\fP * \fIy\fP ¤Ç¤¢¤ë¡£
87 ¤³¤³¤Ç¡¢\fIn\fP ¤Ï \fIx\fP / \fIy\fP ¤Î¾¦¤ò
88 ¥¼¥í¤Ë¸þ¤«¤¦Êý¸þ¤ÇÀ°¿ôÃͤ˴ݤ᤿¤â¤Î¤Ç¤¢¤ë¡£
89 .\"O .SH "RETURN VALUE"
90 .SH ÊÖ¤êÃÍ
91 .\"O On success, these
92 .\"O functions return the value \fIx\fP\ \-\ \fIn\fP*\fIy\fP,
93 .\"O for some integer \fIn\fP,
94 .\"O such that the returned value has the same sign as
95 .\"O .I x
96 .\"O and a magnitude less than the magnitude of
97 .\"O .IR y .
98 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP\ \-\ \fIn\fP*\fIy\fP ¤òÊÖ¤¹¡£
99 \fIn\fP ¤Ï¡¢ÊÖ¤êÃͤ¬
100 .I x
101 ¤ÈƱ¤¸Éä¹æ¤Ç¡¢¤½¤ÎÀäÂÐÃͤ¬
102 .I y
103 ¤ÎÀäÂÐÃͤè¤ê¤â¾®¤µ¤¯¤Ê¤ë¤è¤¦¤ÊÀ°¿ô¤Ç¤¢¤ë¡£
104
105 .\"O If
106 .\"O .I x
107 .\"O or
108 .\"O .I y
109 .\"O is a NaN, a NaN is returned.
110 .I x
111 ¤«
112 .I y
113 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
114
115 .\"O If
116 .\"O .I x
117 .\"O is an infinity,
118 .\"O a domain error occurs, and
119 .\"O a NaN is returned.
120 .I x
121 ¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
122 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
123
124 .\"O If
125 .\"O .I y
126 .\"O is zero,
127 .\"O a domain error occurs, and
128 .\"O a NaN is returned.
129 .I y
130 ¤¬ 0 ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢
131 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
132
133 .\"O If
134 .\"O .I x
135 .\"O is +0 (\-0), and
136 .\"O .I y
137 .\"O is not zero, +0 (\-0) is returned.
138 .I x
139 ¤¬ +0 (\-0) ¤Ç
140 .I y
141 ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£
142 .\"O .SH ERRORS
143 .SH ¥¨¥é¡¼
144 .\"O See
145 .\"O .BR math_error (7)
146 .\"O for information on how to determine whether an error has occurred
147 .\"O when calling these functions.
148 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
149 .BR math_error (7)
150 ¤ò»²¾È¤Î¤³¤È¡£
151 .PP
152 .\"O The following errors can occur:
153 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
154 .TP
155 .\"O Domain error: \fIx\fP is an infinity
156 Îΰ襨¥é¡¼: \fIx\fP ¤¬Ìµ¸ÂÂç
157 .\" .I errno
158 .\" is set to
159 .\" .BR EDOM .
160 .\"O An invalid floating-point exception
161 .\"O .RB ( FE_INVALID )
162 .\"O is raised.
163 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
164 .RB ( FE_INVALID )
165 ¤¬¾å¤¬¤ë¡£
166 .IP
167 .\"O These functions do not set
168 .\"O .IR errno
169 .\"O for this case.
170 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾ì¹ç¤Ë
171 .I errno
172 ¤òÀßÄꤷ¤Ê¤¤¡£
173 .\" FIXME . Is it intentional that these functions do not set errno?
174 .\" They do set errno for the y == 0 case, below.
175 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6784
176 .TP
177 .\"O Domain error: \fIy\fP is zero
178 Îΰ襨¥é¡¼: \fIy\fP ¤¬¥¼¥í
179 .\"O .I errno
180 .\"O is set to
181 .\"O .BR EDOM .
182 .\"O An invalid floating-point exception
183 .\"O .RB ( FE_INVALID )
184 .\"O is raised.
185 .I errno
186 ¤Ë
187 .B EDOM
188 ¤¬ÀßÄꤵ¤ì¤ë¡£
189 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
190 .RB ( FE_INVALID )
191 ¤¬¾å¤¬¤ë¡£
192 .\" POSIX.1 documents an optional underflow error, but AFAICT it doesn't
193 .\" (can't?) occur -- mtk, Jul 2008
194 .\"O .SH "CONFORMING TO"
195 .SH ½àµò
196 C99, POSIX.1-2001.
197 .\"O The variant returning
198 .\"O .I double
199 .\"O also conforms to
200 .\"O SVr4, 4.3BSD, C89.
201 .I double
202 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
203 .\"O .SH "SEE ALSO"
204 .SH ´ØÏ¢¹àÌÜ
205 .BR remainder (3)