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>
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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
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)
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>
40 .\" WORD: remainder function ¾ê;´Ø¿ô
42 .TH FMOD 3 2010-09-20 "" "Linux Programmer's Manual"
45 .\"O fmod, fmodf, fmodl \- floating-point remainder function
46 fmod, fmodf, fmodl \- ÉâÆ°¾®¿ôÅÀ¾ê;´Ø¿ô
52 .BI "double fmod(double " x ", double " y );
54 .BI "float fmodf(float " x ", float " y );
56 .BI "long double fmodl(long double " x ", long double " y );
59 .\"O Link with \fI\-lm\fP.
60 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
63 .\"O Feature Test Macro Requirements for glibc (see
64 .\"O .BR feature_test_macros (7)):
65 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
66 .RB ( feature_test_macros (7)
74 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
75 _POSIX_C_SOURCE\ >=\ 200112L;
85 .\"O function computes the floating-point remainder of dividing \fIx\fP by
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.
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"
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
101 .\"O and a magnitude less than the magnitude of
103 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP\ \-\ \fIn\fP*\fIy\fP ¤òÊÖ¤¹¡£
106 ¤ÈƱ¤¸Éä¹æ¤Ç¡¢¤½¤ÎÀäÂÐÃͤ¬
108 ¤ÎÀäÂÐÃͤè¤ê¤â¾®¤µ¤¯¤Ê¤ë¤è¤¦¤ÊÀ°¿ô¤Ç¤¢¤ë¡£
114 .\"O is a NaN, a NaN is returned.
118 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
123 .\"O a domain error occurs, and
124 .\"O a NaN is returned.
126 ¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
132 .\"O a domain error occurs, and
133 .\"O a NaN is returned.
135 ¤¬ 0 ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢
140 .\"O is +0 (\-0), and
142 .\"O is not zero, +0 (\-0) is returned.
146 ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£
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 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
157 .\"O The following errors can occur:
158 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
160 .\"O Domain error: \fIx\fP is an infinity
161 Îΰ襨¥é¡¼: \fIx\fP ¤¬Ìµ¸ÂÂç
166 .\"O An invalid floating-point exception
167 .\"O .RB ( FE_INVALID )
172 ¤¬ÀßÄꤵ¤ì¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È)¡£
173 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
177 .\"O Domain error: \fIy\fP is zero
178 Îΰ襨¥é¡¼: \fIy\fP ¤¬¥¼¥í
182 .\"O An invalid floating-point exception
183 .\"O .RB ( FE_INVALID )
189 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
192 .\" POSIX.1 documents an optional underflow error, but AFAICT it doesn't
193 .\" (can't?) occur -- mtk, Jul 2008
196 .\"O Before version 2.10, the glibc implementation did not set
197 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6784
201 .\"O when a domain error occurred for an infinite
203 ¥Ð¡¼¥¸¥ç¥ó 2.10 ¤è¤êÁ°¤Î glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢
204 ̵¸ÂÂç¤ÇÎΰ襨¥é¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë¡¢
209 .\"O .SH "CONFORMING TO"
212 .\"O The variant returning
214 .\"O also conforms to
215 .\"O SVr4, 4.3BSD, C89.
217 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£