OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / draft / man3 / ilogb.3
1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
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 .\" Inspired by a page by Walter Harms created 2002-08-10
26 .\"
27 .\" Japanese Version Copyright (c) 2005 Yuichi SATO
28 .\" and Copyright (c) 2008 Akihiro MOTOKI
29 .\" Translated Sat Jan 29 05:17:36 JST 2005
30 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
31 .\" Updated 2008-09-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
32 .\"
33 .TH ILOGB 3 2010-09-20 "" "Linux Programmer's Manual"
34 .\"O .SH NAME
35 .SH Ì¾Á°
36 .\"O ilogb, ilogbf, ilogbl \- get integer exponent of a floating-point value
37 ilogb, ilogbf, ilogbl \- ÉâÆ°¾®¿ôÅÀ¿ô¤Î»Ø¿ôÉô¤òÀ°¿ô¤È¤·¤Æ¼èÆÀ¤¹¤ë
38 .\"O .SH SYNOPSIS
39 .SH ½ñ¼°
40 .B #include <math.h>
41 .sp
42 .BI "int ilogb(double " x );
43 .br
44 .BI "int ilogbf(float " x );
45 .br
46 .BI "int ilogbl(long double " x );
47 .sp
48 .\"O Link with \fI\-lm\fP.
49 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
50 .sp
51 .in -4n
52 .\"O Feature Test Macro Requirements for glibc (see
53 .\"O .BR feature_test_macros (7)):
54 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
55 .RB ( feature_test_macros (7)
56 »²¾È):
57 .in
58 .sp
59 .ad l
60 .BR ilogb ():
61 .RS 4
62 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
63 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED ||
64 _ISOC99_SOURCE ||
65 _POSIX_C_SOURCE\ >=\ 200112L;
66 .br
67 or
68 .I cc\ -std=c99
69 .RE
70 .br
71 .BR ilogbf (),
72 .BR ilogbl ():
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 b
81 .\"O .SH DESCRIPTION
82 .SH ÀâÌÀ
83 .\"O These functions return the exponent part of their argument
84 .\"O as a signed integer.
85 .\"O When no error occurs, these functions
86 .\"O are equivalent to the corresponding
87 .\"O .BR logb (3)
88 .\"O functions, cast to
89 .\"O .IR int .
90 ¤³¤ì¤é¤Î´Ø¿ô¤Ï°ú¤­¿ô¤Î»Ø¿ôÉô¤òÉä¹æÉÕ¤­À°¿ô¤È¤·¤ÆÊÖ¤¹¡£
91 ¥¨¥é¡¼¤¬µ¯¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Âбþ¤¹¤ë
92 .BR logb (3)
93 ´Ø¿ô¤ò
94 .I int
95 ¤Ç¥­¥ã¥¹¥È¤·¤¿¤â¤Î¤ÈÅù²Á¤Ç¤¢¤ë¡£
96 .\"O .SH RETURN VALUE
97 .SH ÊÖ¤êÃÍ
98 .\"O On success, these functions return the exponent of
99 .\"O .IR x ,
100 .\"O as a signed integer.
101 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï
102 .I x
103 ¤Î»Ø¿ôÉô¤òÉä¹æÉÕ¤­À°¿ô¤È¤·¤ÆÊÖ¤¹¡£
104
105 .\"O If
106 .\"O .I x
107 .\"O is zero, then a domain error occurs, and the functions return
108 .\" the POSIX.1 spec for logb() says logb() gives pole error for this
109 .\" case, but for ilogb() it says domain error.
110 .\"O .BR FP_ILOGB0 .
111 .\" glibc: The numeric value is either `INT_MIN' or `-INT_MAX'.
112 .I x
113 ¤¬¥¼¥í¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
114 .B FP_ILOGB0
115 ¤¬ÊÖ¤µ¤ì¤ë¡£
116
117 .\"O If
118 .\"O .I x
119 .\"O is a NaN, then a domain error occurs, and the functions return
120 .\"O .BR FP_ILOGBNAN .
121 .\" glibc: The numeric value is either `INT_MIN' or `INT_MAX'.
122 .\" On i386, FP_ILOGB0 and FP_ILOGBNAN have the same value.
123 .I x
124 ¤¬ NaN ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
125 .B FP_ILOGBNAN
126 ¤¬ÊÖ¤µ¤ì¤ë¡£
127
128 .\"O If
129 .\"O .I x
130 .\"O is negative infinity or positive infinity, then
131 .\"O a domain error occurs, and the functions return
132 .\"O .BR INT_MAX .
133 .I x
134 ¤¬Éé¤Î̵¸ÂÂ礫Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢
135 Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
136 .B INT_MAX
137 ¤¬ÊÖ¤µ¤ì¤ë¡£
138 .\"
139 .\" POSIX.1-2001 also says:
140 .\" If the correct value is greater than {INT_MAX}, {INT_MAX}
141 .\" shall be returned and a domain error shall occur.
142 .\"
143 .\" If the correct value is less than {INT_MIN}, {INT_MIN}
144 .\" shall be returned and a domain error shall occur.
145 .\"O .SH ERRORS
146 .SH ¥¨¥é¡¼
147 .\"O See
148 .\"O .BR math_error (7)
149 .\"O for information on how to determine whether an error has occurred
150 .\"O when calling these functions.
151 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
152 .BR math_error (7)
153 ¤ò»²¾È¤Î¤³¤È¡£
154 .PP
155 .\"O The following errors can occur:
156 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
157 .TP
158 .\"O Domain error: \fIx\fP is 0 or a NaN
159 Îΰ襨¥é¡¼: \fIx\fP ¤¬ 0 ¤« NaN
160 .\" .I errno
161 .\" is set to
162 .\" .BR EDOM .
163 .\"O An invalid floating-point exception
164 .\"O .RB ( FE_INVALID )
165 .\"O is raised.
166 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
167 .RB ( FE_INVALID )
168 ¤¬¾å¤¬¤ë¡£
169 .IP
170 .\"O These functions do not set
171 .\"O .IR errno
172 .\"O for this case.
173 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾õ¶·¤Ç
174 .I errno
175 ¤òÀßÄꤷ¤Ê¤¤¡£
176 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6794
177 .TP
178 .\"O Domain error: \fIx\fP is an infinity
179 Îΰ襨¥é¡¼: \fIx\fP ¤¬Ìµ¸ÂÂç
180 .\" .I errno
181 .\" is set to
182 .\" .BR EDOM .
183 .\" An invalid floating-point exception
184 .\" .RB ( FE_INVALID )
185 .\" is raised.
186 .IP
187 .\"O These functions do not set
188 .\"O .IR errno
189 .\"O or raise an exception for this case.
190 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¾õ¶·¤Ç
191 .I errno
192 ¤òÀßÄꤻ¤º¡¢Îã³°¤â¾å¤²¤Ê¤¤¡£
193 .\" FIXME . Is it intentional that these functions do not set errno,
194 .\" or raise an exception?
195 .\" log(), log2(), log10() do set errno
196 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6794
197 .\"O .SH "CONFORMING TO"
198 .SH ½àµò
199 C99, POSIX.1-2001.
200 .\"O .SH "SEE ALSO"
201 .SH ´ØÏ¢¹àÌÜ
202 .BR log (3),
203 .BR logb (3),
204 .BR significand (3)