OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / fma.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 .\" Distributed under GPL, 2002-07-27 Walter Harms
5 .\" Modified 2004-11-15, Added further text on FLT_ROUNDS
6 .\"     as suggested by AEB and Fabian Kreutz
7 .\"
8 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
9 .\" and Copyright (c) 2008 Akihiro MOTOKI
10 .\" Translated Sat Jul 24 10:37:53 JST 2004
11 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
12 .\" Updated & Modified Mon Jan 10 09:11:49 JST 2005 by Yuichi SATO
13 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
14 .\"
15 .TH FMA 3  2010-09-20 "" "Linux Programmer's Manual"
16 .\"O .SH NAME
17 .SH Ì¾Á°
18 .\"O fma, fmaf, fmal \- floating-point multiply and add
19 fma, fmaf, fmal \- ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÀѤÈϤò·×»»¤¹¤ë
20 .\"O .SH SYNOPSIS
21 .SH ½ñ¼°
22 .nf
23 .B #include <math.h>
24 .sp
25 .BI "double fma(double " x ", double " y ", double " z );
26 .br
27 .BI "float fmaf(float " x ", float " y ", float " z );
28 .br
29 .BI "long double fmal(long double " x ", long double " y ", long double " z );
30 .fi
31 .sp
32 .\"O Link with \fI\-lm\fP.
33 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
34 .sp
35 .in -4n
36 .\"O Feature Test Macro Requirements for glibc (see
37 .\"O .BR feature_test_macros (7)):
38 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
39 .RB ( feature_test_macros (7)
40 »²¾È):
41 .in
42 .sp
43 .ad l
44 .BR fma (),
45 .BR fmaf (),
46 .BR fmal ():
47 .RS 4
48 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
49 _POSIX_C_SOURCE\ >=\ 200112L;
50 .br
51 or
52 .I cc\ -std=c99
53 .RE
54 .ad
55 .\"O .SH DESCRIPTION
56 .SH ÀâÌÀ
57 .\"O The
58 .\"O .BR fma ()
59 .\"O function computes
60 .\"O .IR x " * " y " + " z .
61 .BR fma ()
62 ´Ø¿ô¤Ï
63 .IR x " * " y " + " z
64 ¤ò·×»»¤¹¤ë¡£
65 .\"O The result is rounded as one ternary operation according to the
66 .\"O current rounding mode (see
67 .\"O .BR fenv (3)).
68 ·ë²Ì¤Ï¡¢°ì¤Ä¤Î»°¹à±é»»¤È¤·¤Æ¸½ºß¤Î´Ý¤á¥â¡¼¥É¤Ë¤·¤¿¤¬¤Ã¤Æ´Ý¤á¤é¤ì¤ë
69 .RB ( fenv (3)
70 »²¾È)¡£
71 .\"O .SH RETURN VALUE
72 .SH ÊÖ¤êÃÍ
73 .\"O These functions return the value of
74 .\"O .IR x " * " y " + " z ,
75 .\"O rounded as one ternary operation.
76 ¤³¤ì¤é¤Î´Ø¿ô¤Ï
77 .IR x " * " y " + " z
78 ¤Î¡¢°ì¤Ä¤Î»°¹à±é»»¤È¤·¤Æ´Ý¤á¤é¤ì¤¿ÃͤòÊÖ¤¹¡£
79
80 .\"O If
81 .\"O .I x
82 .\"O or
83 .\"O .I y
84 .\"O is a NaN, a NaN is returned.
85 .I x
86 ¤«
87 .I y
88 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
89
90 .\"O If
91 .\"O .I x
92 .\"O times
93 .\"O .I y
94 .\"O is an exact infinity, and
95 .\"O .I z
96 .\"O is an infinity with the opposite sign,
97 .\"O a domain error occurs,
98 .\"O and a NaN is returned.
99 .I y
100 ¤Î
101 .I x
102 Çܤ¬¤Á¤ç¤¦¤É̵¸ÂÂç¤Ç¡¢
103 .I z
104 ¤¬¤½¤ì¤È¤ÏÈ¿ÂФÎÉä¹æ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢
105 Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
106
107 .\" POSIX.1-2008 allows some possible differences for the following two
108 .\" domain error cases, but on Linux they are treated the same (AFAICS).
109 .\" Nevertheless, we'll mirror POSIX.1 and describe the two cases
110 .\" separately.
111 .\"O If one of
112 .\"O .I x
113 .\"O or
114 .\"O .I y
115 .\"O is an infinity, the other is 0, and
116 .\"O .I z
117 .\"O is not a NaN,
118 .\"O a domain error occurs, and
119 .\"O a NaN is returned.
120 .I x
121 ¤È
122 .I y
123 ¤Î¤¦¤Á°ìÊý¤¬Ìµ¸ÂÂç¤Ç¡¢¤â¤¦°ìÊý¤¬ 0 ¤Ç¡¢
124 .I z
125 ¤¬ NaN ¤Ç¤Ê¤¤¾ì¹ç¡¢Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
126 .\" POSIX.1 says that a NaN or an implementation-defined value shall
127 .\" be returned for this case.
128
129 .\"O If one of
130 .\"O .I x
131 .\"O or
132 .\"O .I y
133 .\"O is an infinity, and the other is 0, and
134 .\"O .I z
135 .\"O is a NaN,
136 .\" POSIX.1 makes the domain error optional for this case.
137 .\"O a domain error occurs, and
138 .\"O a NaN is returned.
139 .I x
140 ¤È
141 .I y
142 ¤Î¤¦¤Á°ìÊý¤¬Ìµ¸ÂÂç¤Ç¡¢¤â¤¦°ìÊý¤¬ 0 ¤Ç¡¢
143 .I z
144 ¤¬ NaN ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼¤¬È¯À¸¤·¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
145
146 .\"O If
147 .\"O .I x
148 .\"O times
149 .\"O .I y
150 .\"O is not an infinity times zero (or vice versa), and
151 .\"O .I z
152 .\"O is a NaN,
153 .\"O a NaN is returned.
154 .I y
155 ¤Î
156 .I x
157 Çܤ¬ 0 ¤Î̵¸ÂÂçÇÜ (¤â¤·¤¯¤Ï¤½¤ÎµÕ) ¤Ç¤Ï¤Ê¤¯¡¢
158 .I z
159 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
160
161 .\"O If the result overflows,
162 .\"O a range error occurs, and
163 .\"O an infinity with the correct sign is returned.
164 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
165 Àµ¤·¤¤Éä¹æ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
166
167 .\"O If the result underflows,
168 .\"O a range error occurs, and
169 .\"O a signed 0 is returned.
170 ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢
171 ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢Éä¹æÉÕ¤­¤Î 0 ¤¬ÊÖ¤µ¤ì¤ë¡£
172 .\"O .SH ERRORS
173 .SH ¥¨¥é¡¼
174 .\"O See
175 .\"O .BR math_error (7)
176 .\"O for information on how to determine whether an error has occurred
177 .\"O when calling these functions.
178 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
179 .BR math_error (7)
180 ¤ò»²¾È¤Î¤³¤È¡£
181 .PP
182 .\"O The following errors can occur:
183 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
184 .TP
185 .\"O Domain error: \fIx\fP * \fIy\fP + \fIz\fP, \
186 .\"O or \fIx\fP * \fIy\fP is invalid and \fIz\fP is not a NaN
187 Îΰ襨¥é¡¼: \fIx\fP * \fIy\fP + \fIz\fP ¤« \
188 \fIx\fP * \fIy\fP ¤¬Ìµ¸ú¤Ç¡¢\fIz\fP ¤¬ NaN ¤Ç¤Ï¤Ê¤¤
189 .\" .I errno
190 .\" is set to
191 .\" .BR EDOM .
192 .\"O An invalid floating-point exception
193 .\"O .RB ( FE_INVALID )
194 .\"O is raised.
195 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
196 .RB ( FE_INVALID )
197 ¤¬¾å¤¬¤ë¡£
198 .TP
199 .\"O Range error: result overflow
200 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
201 .\" .I errno
202 .\" is set to
203 .\" .BR ERANGE .
204 .\"O An overflow floating-point exception
205 .\"O .RB ( FE_OVERFLOW )
206 .\"O is raised.
207 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
208 .RB ( FE_OVERFLOW )
209 ¤¬¾å¤¬¤ë¡£
210 .TP
211 .\"O Range error: result underflow
212 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼
213 .\" .I errno
214 .\" is set to
215 .\" .BR ERANGE .
216 .\"O An underflow floating-point exception
217 .\"O .RB ( FE_UNDERFLOW )
218 .\"O is raised.
219 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
220 .RB ( FE_UNDERFLOW )
221 ¤¬¾å¤¬¤ë¡£
222 .PP
223 .\"O These functions do not set
224 .\"O .IR errno .
225 ¤³¤ì¤é¤Î´Ø¿ô¤Ï
226 .I errno
227 ¤òÀßÄꤷ¤Ê¤¤¡£
228 .\" FIXME . Is it intentional that these functions do not set errno?
229 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6801
230 .\"O .SH VERSIONS
231 .SH ¥Ð¡¼¥¸¥ç¥ó
232 .\"O These functions first appeared in glibc in version 2.1.
233 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
234 .\"O .SH "CONFORMING TO"
235 .SH ½àµò
236 C99, POSIX.1-2001.
237 .\"O .SH "SEE ALSO"
238 .SH ´ØÏ¢¹àÌÜ
239 .BR remainder (3),
240 .BR remquo (3)