1 .\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI
25 .\" all rights reserved.
26 .\" Translated 2008-08-17, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.07
28 .\"WORD: significand ²¾¿ôÉô
29 .\"WORD: domain error Îΰ襨¥é¡¼
30 .\"WORD: pole error ¶Ë¥¨¥é¡¼
31 .\"WORD: range error ÈÏ°Ï¥¨¥é¡¼
33 .TH MATH_ERROR 7 2008-08-11 "Linux" "Linux Programmer's Manual"
35 math_error \- ¿ô³Ø´Ø¿ô¤«¤é¤Î¥¨¥é¡¼¤Î¸¡½Ð
43 ¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¤Û¤È¤ó¤É¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï (\-1 ¤ä NULL ¤Ê¤É¤Î)
44 ÆÃÊ̤ÊÃͤòÊÖ¤¹¤³¤È¤Ç¥¨¥é¡¼¤òÄÌÃΤ¹¤ë¡£
46 ¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë¿ô³Ø´Ø¿ô¤Ï¡¢Ä̾ï¤ÏÉâÆ°¾®¿ôÅÀÃͤòÊÖ¤¹¤Î¤Ç¡¢
47 ¾¤Îµ¡¹½¤ò»È¤Ã¤Æ¥¨¥é¡¼¤òÄÌÃΤ¹¤ë¡£
48 ¥¨¥é¡¼ÄÌÃε¡¹½¤Ï 2 ¼ïÎढ¤ê¡¢
51 ¤òÀßÄꤹ¤ë¤ä¤êÊý¤Ç¤¢¤ê¡¢¿·¤·¤¤¤â¤Î¤¬
53 ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ëÉâÆ°¾®¿ôÅÀÎã³°µ¡¹½¤Ç¤¢¤ë¡£
54 .RB ( feclearexcept (3)
57 ¤ò»ÈÍѤ¹¤ë¡£¤³¤ì¤é¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤Ç³µÍפòÀâÌÀ¤·¤Æ¤¤¤ë¡£)
59 °Ü¿¢À¤¬É¬Í×¤Ê¥×¥í¥°¥é¥à¤Ç¡¢¿ô³Ø´Ø¿ô¤«¤é¤Î¥¨¥é¡¼¤ò³Îǧ¤¹¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢
60 ¿ô³Ø´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë
62 ¤ò 0 ¤ËÀßÄꤷ¡¢°Ê²¼¤ò¸Æ¤Ó½Ð¤¹¤Ù¤¤Ç¤¢¤ë¡£
66 feclearexcept(FE_ALL_EXCEPT);
70 ¿ô³Ø´Ø¿ô¤«¤éÊ֤äƤ¤¿ºÝ¤Ë¡¢
72 ¤¬ 0 °Ê³°¤«¡¢°Ê²¼¤Î¸Æ¤Ó½Ð¤·¤¬ 0 °Ê³°¤òÊÖ¤·¤¿¾ì¹ç
74 »²¾È)¡¢¿ô³Ø´Ø¿ô¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë¡£
78 fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW |
84 .\" FE_INVALID = 0x01,
85 .\" __FE_DENORM = 0x02,
86 .\" FE_DIVBYZERO = 0x04,
87 .\" FE_OVERFLOW = 0x08,
88 .\" FE_UNDERFLOW = 0x10,
92 ¿ô³Ø´Ø¿ô¤ÇȯÀ¸¤¹¤ë¥¨¥é¡¼¾ò·ï¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤ÇÀâÌÀ¤¹¤ë¡£
93 .SS Îΰ襨¥é¡¼ (domain error)
95 ¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢¿ô³Ø´Ø¿ô¤ËÅϤµ¤ì¤¿°ú¤¿ô¤ÎÃͤ¬¤½¤Î´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë
96 Îΰè¤ËÆþ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤¢¤ë (Î㤨¤Ð
98 ¤ËÉé¤Î°ú¤¿ô¤òÅϤ·¤¿¾ì¹ç)¡£
99 Îΰ襨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢
100 ¿ô³Ø´Ø¿ô¤ÏÉáÄÌ¤Ï NaN ¤òÊÖ¤·
101 (Ʊ¤¸¾õ¶·¤Ç°ã¤¦ÃͤòÊÖ¤¹´Ø¿ô¤â¤¢¤ë)¡¢
105 ¤òÀßÄꤷ¡¢¡Ö̵¸ú (invalid)¡×
109 .SS ¶Ë¥¨¥é¡¼ (pole error)
111 ¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢´Ø¿ô¤Î¿ô³ØŪ¤Ê·ë²Ì¤¬Ìµ¸ÂÂ礽¤Î¤â¤Î¤È¤Ê¤ë¾ì¹ç¤Ç¤¢¤ë
113 0 ¤ÎÂпô¤ÏÉé¤Î̵¸ÂÂç¤Ç¤¢¤ë)¡£
114 ¶Ë¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¤½¤Î´Ø¿ô¤ÎÊÖ¤êÃÍ¤Ï (Éä¹æÉÕ¤¤Î)
118 ¤Î¤¤¤º¤ì¤«¤È¤Ê¤ë (Á°µ¤ÎÃͤΤ¦¤Á¤É¤ì¤¬Ê֤뤫¤Ï´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ë¤è¤ê·è¤Þ¤ê¡¢
124 ·ë²Ì¤ÎÉä¹æ¤Ï¡¢¤½¤Î´Ø¿ô¤Î¿ô³ØŪ¤ÊÄêµÁ¤«¤é·èÄꤵ¤ì¤ë¡£
128 ¤ËÀßÄꤵ¤ì¡¢¡Ö0 ¤Ë¤è¤ë½ü»» (divide-by-zero)¡×
132 .SS ÈÏ°Ï¥¨¥é¡¼ (range ¥¨¥é¡¼)
134 ¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢´Ø¿ô¤Î·ë²Ì¤ÎÃͤ¬¤½¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ç¤Ïɽ¸½¤Ç¤¤Ê¤¤¾ì¹ç
135 ¤Ç¤¢¤ë¡£´Ø¿ô¤ÎÊÖ¤êÃͤϡ¢ÈÏ°Ï¥¨¥é¡¼¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ç¤¢¤Ã¤¿¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼
136 ¤Ç¤¢¤Ã¤¿¤«¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
138 ÉâÆ°¾®¿ôÅÀ¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï¡¢·ë²Ì¤¬Í¸Â¤À¤¬¡¢Â礲᤮¤Æ
139 ·ë²Ì¤òÊÖ¤¹·¿¤Ç¤Ïɽ¸½¤Ç¤¤Ê¤¤¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£
140 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤¹¤ë¤È¡¢
145 ¤Î¤¤¤º¤ì¤«¤òÊÖ¤¹ (Á°µ¤ÎÃͤΤ¦¤Á¤É¤ì¤¬Ê֤뤫¤Ï´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ë¤è¤ê·è¤Þ¤ê¡¢
154 ¤ËÀßÄꤵ¤ì¡¢¡Ö¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ (overflow)¡×
159 ÉâÆ°¾®¿ôÅÀ¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Ï¡¢
160 ·ë²Ì¤¬¾®¤µ²á¤®¤Æ¡¢·ë²Ì¤òÊÖ¤¹·¿¤Ç¤Ïɽ¸½¤Ç¤¤Ê¤¤¾ì¹ç¤ËȯÀ¸¤¹¤ë¡£
161 ¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬È¯À¸¤¹¤ë¤È¡¢¿ô³Ø´Ø¿ô¤ÏÄ̾ï¤Ï 0.0 ¤òÊÖ¤¹
162 (C99 ¤Ç¤Ï¡¢»ØÄꤵ¤ì¤¿·¿¤Ë¤ª¤¤¤ÆºÇ¾®¤ÎÀµµ¬²½¤µ¤ì¤¿Àµ¤ÎÃͤè¤êÂ礤¯¤Ê¤¤
163 Ãͤò»ý¤Ä¼ÂÁõÄêµÁ (implementation-defined) ¤ÎÃͤòÊÖ¤¹¡¢¤È¤Ê¤Ã¤Æ¤¤¤ë)¡£
167 ¤ËÀßÄꤵ¤ì¡¢¡Ö¥¢¥ó¥À¡¼¥Õ¥í¡¼¡×ÉâÆ°¾®¿ôÅÀÎã³°
171 ¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤Ç¤Ï¡¢ÅϤµ¤ì¤¿°ú¤¿ô¤ÎÃͤ䡢Àµ¤·¤¤´Ø¿ô¤Î·ë²Ì¤¬
172 .I subnormal (ÈóÀµµ¬²½¿ô)
173 ¤Ë¤Ê¤ë¾ì¹ç¤ËÈÏ°Ï¥¨¥é¡¼¤ò¾å¤²¤ë¡£
174 subnormal ¤ÊÃͤȤϡ¢0 ¤Ç¤Ï¤Ê¤¤¤¬¡¢¤½¤ÎÃͤ¬¾®¤µ¤¹¤®¤Æ
175 (²¾¿ôÉô¤ÎºÇ¾å°Ì¥Ó¥Ã¥È¤¬ 1 ¤È¤Ê¤ë) ɸ½à·Á¤Ç¤Ïɽ¸½¤Ç¤¤Ê¤¤¤è¤¦¤ÊÃͤǤ¢¤ë¡£
176 subnormal ¤ÊÃͤÎɽ¸½¤Ç¤Ï¡¢²¾¿ôÉô¤Î¾å°Ì¦¤Î¥Ó¥Ã¥È¤Ë 1 ¸Ä°Ê¾å¤Î 0 ¤¬
179 C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë
181 ¼±ÊÌ»Ò¤Ï glibc ¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
182 .\" See CONFORMANCE in the glibc 2.8 (and earlier) source.
183 ¤³¤Î¼±Ê̻Ҥϡ¢2 ¤Ä¤Î¥¨¥é¡¼ÄÌÃε¡¹½
187 ·Ðͳ¤Ç¼èÆÀ¤Ç¤¤ëÎã³°) ¤Î¤¦¤Á¤É¤Á¤é¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¤òÄÌÃÎ
188 ¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
189 ɸ½à¤Ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Ï»ÈÍѤµ¤ì¤ë¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¤¬¡¢
190 ξÊý¤È¤âÍøÍѲÄǽ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¤È¤µ¤ì¤Æ¤¤¤ë¡£
191 glibc ¤Ç¤Î¸½ºß¤Î (¥Ð¡¼¥¸¥ç¥ó 2.8 ¤Ç¤Î) ¾õ¶·¤Ï¤«¤Ê¤êº®Í𤷤Ƥ¤¤ë¡£
192 ¤Û¤È¤ó¤É¤Î´Ø¿ô (¤¿¤À¤·Á´Éô¤Ç¤Ï¤Ê¤¤) ¤Ï¥¨¥é¡¼»þ¤ËÎã³°¤ò¾å¤²¤ë¡£
197 ¤òÀßÄꤹ¤ë¤¬¡¢Îã³°¤ò¾å¤²¤Ê¤¤´Ø¿ô¤â¾¯¤·¤À¤±Â¸ºß¤¹¤ë¡£
198 ¤É¤Á¤é¤â¹Ô¤ï¤Ê¤¤´Ø¿ô¤â¤´¤¯¾¯¿ô¤À¤¬Â¸ºß¤¹¤ë¡£
199 ¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¸Ä¡¹¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£
204 ¤ÎξÊý¤ò»È¤Ã¤Æ¥¨¥é¡¼¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤³¤È¤ÇÊ£»¨¤Ë¤Ê¤ë¤Î¤òÈò¤±¤ë¤¿¤á¡¢
205 ¿¤¯¤Î¾ì¹ç¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦Á°¤ËÉÔÀµ¤Ê°ú¤¿ô¤«¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦
206 ÊýË¡¤¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£
207 .\" http://www.securecoding.cert.org/confluence/display/seccode/FLP32-C.+Prevent+or+detect+domain+and+range+errors+in+math+functions
208 Î㤨¤Ð¡¢°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢
210 ¤Î°ú¤¿ô¤¬ NaN ¤Ç¤â (¶Ë¥¨¥é¡¼¤È¤Ê¤ë) 0 ¤Ç¤â (Îΰ襨¥é¡¼¤È¤Ê¤ë) 0 ̤Ëþ
211 ¤Ç¤â¤Ê¤¤¤³¤È¤òÊݾڤ¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
217 if (isnan(x) || islessequal(x, 0)) {
218 /* Deal with NaN / pole error / domain error */
225 ¤³¤Î¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤³¤È¤Ï¡¢
227 ¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë) Ê£ÁÇ¿ô´Ø¿ô¤Ë¤Ï¤¢¤Æ¤Ï¤Þ¤é¤Ê¤¤¡£
228 °ìÈ̤ˡ¢C99 ¤ä POSIX.1-2001 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤¬¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤ò
234 ¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤È¡¢¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç¡¢É¸½à¤Î¼ÂÁõ¤è¤ê¤â¹â®¤Ê¿ô³Ø´Ø¿ô¤Î
235 ¼ÂÁõ¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤¬¡¢
242 ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤â
245 ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¤Ç¤â¡¢
247 ¤ò»È¤Ã¤¿¥¨¥é¡¼¤Î¸¡ºº¤Ï²Äǽ¤Ç¤¢¤ë¡£