OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / 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  2010-09-20 "" "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 .RS 4
74 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
75 _POSIX_C_SOURCE\ >=\ 200112L;
76 .br
77 or
78 .I cc\ -std=c99
79 .RE
80 .ad
81 .\"O .SH DESCRIPTION
82 .SH ÀâÌÀ
83 .\"O The
84 .\"O .BR fmod ()
85 .\"O function computes the floating-point remainder of dividing \fIx\fP by
86 .\"O \fIy\fP.
87 .\"O The return value is \fIx\fP \- \fIn\fP * \fIy\fP, where \fIn\fP
88 .\"O is the quotient of \fIx\fP / \fIy\fP, rounded toward zero to an integer.
89 .BR fmod ()
90 ´Ø¿ô¤Ï \fIx\fP ¤ò \fIy\fP ¤Ç³ä¤Ã¤¿ÉâÆ°¾®¿ôÅÀ¾ê;¤ò·×»»¤¹¤ë¡£
91 ÊÖ¤êÃͤϠ\fIx\fP \- \fIn\fP * \fIy\fP ¤Ç¤¢¤ë¡£
92 ¤³¤³¤Ç¡¢\fIn\fP ¤Ï \fIx\fP / \fIy\fP ¤Î¾¦¤ò
93 ¥¼¥í¤Ë¸þ¤«¤¦Êý¸þ¤ÇÀ°¿ôÃͤ˴ݤ᤿¤â¤Î¤Ç¤¢¤ë¡£
94 .\"O .SH "RETURN VALUE"
95 .SH ÊÖ¤êÃÍ
96 .\"O On success, these
97 .\"O functions return the value \fIx\fP\ \-\ \fIn\fP*\fIy\fP,
98 .\"O for some integer \fIn\fP,
99 .\"O such that the returned value has the same sign as
100 .\"O .I x
101 .\"O and a magnitude less than the magnitude of
102 .\"O .IR y .
103 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP\ \-\ \fIn\fP*\fIy\fP ¤òÊÖ¤¹¡£
104 \fIn\fP ¤Ï¡¢ÊÖ¤êÃͤ¬
105 .I x
106 ¤ÈƱ¤¸Éä¹æ¤Ç¡¢¤½¤ÎÀäÂÐÃͤ¬
107 .I y
108 ¤ÎÀäÂÐÃͤè¤ê¤â¾®¤µ¤¯¤Ê¤ë¤è¤¦¤ÊÀ°¿ô¤Ç¤¢¤ë¡£
109
110 .\"O If
111 .\"O .I x
112 .\"O or
113 .\"O .I y
114 .\"O is a NaN, a NaN is returned.
115 .I x
116 ¤«
117 .I y
118 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
119
120 .\"O If
121 .\"O .I x
122 .\"O is an infinity,
123 .\"O a domain error occurs, and
124 .\"O a NaN is returned.
125 .I x
126 ¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
127 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
128
129 .\"O If
130 .\"O .I y
131 .\"O is zero,
132 .\"O a domain error occurs, and
133 .\"O a NaN is returned.
134 .I y
135 ¤¬ 0 ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢
136 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
137
138 .\"O If
139 .\"O .I x
140 .\"O is +0 (\-0), and
141 .\"O .I y
142 .\"O is not zero, +0 (\-0) is returned.
143 .I x
144 ¤¬ +0 (\-0) ¤Ç
145 .I y
146 ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£
147 .\"O .SH ERRORS
148 .SH ¥¨¥é¡¼
149 .\"O See
150 .\"O .BR math_error (7)
151 .\"O for information on how to determine whether an error has occurred
152 .\"O when calling these functions.
153 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
154 .BR math_error (7)
155 ¤ò»²¾È¤Î¤³¤È¡£
156 .PP
157 .\"O The following errors can occur:
158 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
159 .TP
160 .\"O Domain error: \fIx\fP is an infinity
161 Îΰ襨¥é¡¼: \fIx\fP ¤¬Ìµ¸ÂÂç
162 .\"O .I errno
163 .\"O is set to
164 .\"O .BR EDOM
165 .\"O (but see BUGS).
166 .\"O An invalid floating-point exception
167 .\"O .RB ( FE_INVALID )
168 .\"O is raised.
169 .I errno
170 ¤Ë
171 .B EDOM
172 ¤¬ÀßÄꤵ¤ì¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È)¡£
173 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
174 .RB ( FE_INVALID )
175 ¤¬¾å¤¬¤ë¡£
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 BUGS
195 .SH ¥Ð¥°
196 .\"O Before version 2.10, the glibc implementation did not set
197 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6784
198 .\"O .I errno
199 .\"O to
200 .\"O .B EDOM
201 .\"O when a domain error occurred for an infinite
202 .\"O .IR x .
203 ¥Ð¡¼¥¸¥ç¥ó 2.10 ¤è¤êÁ°¤Î glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢
204 ̵¸ÂÂç¤ÇÎΰ襨¥é¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë¡¢
205 .I error
206 ¤Ë
207 .B EDOM
208 ¤¬ÀßÄꤵ¤ì¤Ê¤«¤Ã¤¿¡£
209 .\"O .SH "CONFORMING TO"
210 .SH ½àµò
211 C99, POSIX.1-2001.
212 .\"O The variant returning
213 .\"O .I double
214 .\"O also conforms to
215 .\"O SVr4, 4.3BSD, C89.
216 .I double
217 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
218 .\"O .SH "SEE ALSO"
219 .SH ´ØÏ¢¹àÌÜ
220 .BR remainder (3)