OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / fpclassify.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL, 2002-07-27 Walter Harms
3 .\" This was done with the help of the glibc manual.
4 .\"
5 .\" 2004-10-31, aeb, corrected
6 .\"
7 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
8 .\"         all rights reserved.
9 .\" Translated 2004-07-27, Yuichi SATO <ysato444@yahoo.co.jp>
10 .\" Updated & Modified 2005-01-10, Yuichi SATO
11 .\" Updated & Modified 2005-09-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
12 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
13 .\"
14 .TH FPCLASSIFY 3  2010-09-20 "" "Linux Programmer's Manual"
15 .\"O .SH NAME
16 .SH Ì¾Á°
17 .\"O fpclassify, isfinite, isnormal, isnan, isinf \- floating-point
18 .\"O classification macros
19 fpclassify, isfinite, isnormal, isnan, isinf \- ÉâÆ°¾®¿ôÅÀ¿ô¤ÎʬÎà¥Þ¥¯¥í
20 .\"O .SH SYNOPSIS
21 .SH ½ñ¼°
22 .nf
23 .B #include <math.h>
24 .sp
25 .BI "int fpclassify(" x );
26 .sp
27 .BI "int isfinite(" x );
28 .sp
29 .BI "int isnormal(" x );
30 .sp
31 .BI "int isnan(" x );
32 .sp
33 .BI "int isinf(" x );
34 .fi
35 .sp
36 .\"O Link with \fI\-lm\fP.
37 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
38 .sp
39 .in -4n
40 .\"O Feature Test Macro Requirements for glibc (see
41 .\"O .BR feature_test_macros (7)):
42 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
43 .RB ( feature_test_macros (7)
44 »²¾È):
45 .in
46 .sp
47 .\" I haven't fully grokked the source to determine the FTM requirements;
48 .\" in part, the following has been tested by experiment.
49 .ad l
50 .BR fpclassify (),
51 .BR isfinite (),
52 .BR isnormal ():
53 .RS 4
54 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
55 _POSIX_C_SOURCE\ >=\ 200112L;
56 .br
57 or
58 .I cc\ -std=c99
59 .RE
60 .BR isnan ():
61 .RS 4
62 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
63 _POSIX_C_SOURCE\ >=\ 200112L;
64 .br
65 or
66 .I cc\ -std=c99
67 .RE
68 .BR isinf ():
69 .RS 4
70 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
71 _POSIX_C_SOURCE\ >=\ 200112L;
72 .br
73 or
74 .I cc\ -std=c99
75 .RE
76 .ad
77 .\"O .SH DESCRIPTION
78 .SH ÀâÌÀ
79 .\"O Floating point numbers can have special values, such as
80 .\"O infinite or NaN.
81 .\"O With the macro
82 .\"O .BI fpclassify( x )
83 .\"O you can find out what type
84 .\"O .I x
85 .\"O is.
86 .\"O The macro takes any floating-point expression as argument.
87 ÉâÆ°¾®¿ôÅÀ¿ô¤Ï̵¸ÂÂç¤ä NaN ¤Î¤è¤¦¤ÊÆÃÊ̤ÊÃͤò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£
88 ¥Þ¥¯¥í
89 .BI fpclassify( x )
90 ¤Ç
91 .I x
92 ¤¬¤É¤Î¤è¤¦¤Ê¼ïÊ̤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£
93 ¥Þ¥¯¥í¤ÏǤ°Õ¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤ò°ú¤­¿ô¤È¤·¤Æ¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
94 .\"O The result is one of the following values:
95 ·ë²Ì¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤Ç¤¢¤ë:
96 .TP 14
97 .B FP_NAN
98 .\"O .I x
99 .\"O is "Not a Number".
100 .I x
101 ¤¬ "Not a Number" ¤Ç¤¢¤ë (¿ôÃͤǤϤʤ¤)¡£
102 .TP
103 .B FP_INFINITE
104 .\"O .I x
105 .\"O is either positive infinity or negative infinity.
106 .I x
107 ¤¬Àµ¤Î̵¸ÂÂç¤Þ¤¿¤ÏÉé¤Î̵¸ÂÂç¤Ç¤¢¤ë¡£
108 .TP
109 .B FP_ZERO
110 .\"O .I x
111 .\"O is zero.
112 .I x
113 ¤¬ 0 ¤Ç¤¢¤ë¡£
114 .TP
115 .B FP_SUBNORMAL
116 .\"O .I x
117 .\"O is too small to be represented in normalized format.
118 .I x
119 ¤òÀµµ¬²½·Á¼°¤Çɽ¸½¤¹¤ë¤Ë¤Ï¾®¤µ¤¹¤®¤ë¡£
120 .TP
121 .B FP_NORMAL
122 .\"O if nothing of the above is correct then it must be a
123 .\"O normal floating-point number.
124 ¾åµ­¤Î¤É¤ì¤Ë¤âÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¤Ç¤¢¤ê¡¢
125 ÃͤÏÄ̾ï¤ÎÉâÆ°¾®¿ôÅÀ¿ô¤Ç¤¢¤ë¤Ï¤º¤À¡£
126 .LP
127 .\"O The other macros provide a short answer to some standard questions.
128 ¾¤Î¥Þ¥¯¥í¤Ï¡¢¤¤¤¯¤Ä¤«¤Îɸ½àŪ¤ÊÌ䤤¤ËÂФ·¤Æ¡¢´Êñ¤ÊÅú¤¨¤òÄ󶡤¹¤ë¡£
129 .TP 14
130 .BI isfinite( x )
131 .\"O returns a nonzero value if
132 .\"O .br
133 .\"O (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
134 (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
135 ¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£
136 .TP
137 .BI isnormal( x )
138 .\"O returns a nonzero value if
139 .\"O (fpclassify(x) == FP_NORMAL)
140 (fpclassify(x) == FP_NORMAL)
141 ¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£
142 .TP
143 .BI isnan( x )
144 .\"O returns a nonzero value if
145 .\"O (fpclassify(x) == FP_NAN)
146 (fpclassify(x) == FP_NAN)
147 ¤Î¾ì¹ç¤Ë 0 °Ê³°¤ÎÃͤòÊÖ¤¹¡£
148 .TP
149 .BI isinf( x )
150 .\"O returns 1 if
151 .\"O .I x
152 .\"O is positive infinity, and \-1 if
153 .\"O .I x
154 .\"O is negative infinity.
155 .I x
156 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¤Ï 1 ¤ò¡¢
157 Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£
158 .\"O .SH "CONFORMING TO"
159 .SH ½àµò
160 C99, POSIX.1.
161
162 .\"O For
163 .\"O .BR isinf (),
164 .\"O the standards merely say that the return value is nonzero
165 .\"O if and only if the argument has an infinite value.
166 .BR isinf ()
167 ¤Ë´Ø¤·¤Æ¡¢É¸½àµ¬³Ê¤ÇÄê¤á¤é¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢
168 ÊÖ¤êÃͤ¬ 0 °Ê³°¤Ë¤Ê¤ë¤Î¤Ï°ú¤­¿ô¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¤À¤±¤È¤¤¤¦¤³¤È¤À¤±¤Ç¤¢¤ë¡£
169 .\"O .SH NOTES
170 .SH Ãí°Õ
171 .\"O In glibc 2.01 and earlier,
172 .\"O .BR isinf ()
173 .\"O returns a nonzero value (actually: 1) if
174 .\"O .I x
175 .\"O is positive infinity or negative infinity.
176 .\"O (This is all that C99 requires.)
177 glibc 2.01 °ÊÁ°¤Ç¤Ï¡¢
178 .BR isinf ()
179 ¤Ï
180 .I x
181 ¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢
182 0 °Ê³°¤ÎÃÍ (¼ÂºÝ¤Ë¤Ï 1) ¤òÊÖ¤¹
183 (C99 ¤ÎÍ×µá»ÅÍͤǷè¤Þ¤Ã¤Æ¤¤¤ë¤Î¤Ï
184 0 °Ê³°¤ÎÃͤòÊÖ¤¹¤È¤¤¤¦¤³¤È¤À¤±¤Ç¤¢¤ë)¡£
185 .\"O .SH "SEE ALSO"
186 .SH ´ØÏ¢¹àÌÜ
187 .BR finite (3),
188 .BR INFINITY (3),
189 .BR isgreater (3),
190 .BR signbit (3)