OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / nextafter.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
5 .\" Based on glibc infopages
6 .\"
7 .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI all rights reserved.
8 .\" Translated Mon Jan 27 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
9 .\" Updated 2008-09-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
10 .\"
11 .\"WORD:        mantissa        ²¾¿ôÉô
12 .\"WORD:        normalized      Àµµ¬²½¤µ¤ì¤¿
13 .\"WORD:        subnormal       ÈóÀµµ¬²½¤Î
14 .\"
15 .TH NEXTAFTER 3 2009-12-05 "GNU" "Linux Programmer's Manual"
16 .\"O .SH NAME
17 .\"O nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \-
18 .\"O floating-point number manipulation
19 .SH Ì¾Á°
20 nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \-
21 ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÁàºî
22 .\"O .SH SYNOPSIS
23 .SH ½ñ¼°
24 .B #include <math.h>
25 .sp
26 .BI "double nextafter(double " x ", double " y );
27 .br
28 .BI "float nextafterf(float " x ", float " y );
29 .br
30 .BI "long double nextafterl(long double " x ", long double " y );
31 .sp
32 .BI "double nexttoward(double " x ", long double " y );
33 .br
34 .BI "float nexttowardf(float " x ", long double " y );
35 .br
36 .BI "long double nexttowardl(long double " x ", long double " y );
37 .sp
38 .\"O Link with \fI\-lm\fP.
39 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
40 .sp
41 .in -4n
42 .\"O Feature Test Macro Requirements for glibc (see
43 .\"O .BR feature_test_macros (7)):
44 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
45 .RB ( feature_test_macros (7)
46 »²¾È):
47 .in
48 .sp
49 .ad l
50 .BR nextafter ():
51 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or
52 .I cc\ -std=c99
53 .br
54 .BR nextafterf (),
55 .BR nextafterl ():
56 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
57 .I cc\ -std=c99
58 .br
59 .BR nexttoward (),
60 .BR nexttowardf (),
61 .BR nexttowardl ():
62 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE;
63 .I cc\ -std=c99
64 .ad b
65 .\"O .SH DESCRIPTION
66 .SH ÀâÌÀ
67 .\"O The
68 .\"O .BR nextafter ()
69 .\"O functions return the next representable floating-point value following
70 .\"O .I x
71 .\"O in the direction of
72 .\"O .IR y .
73 .\"O If
74 .\"O .I y
75 .\"O is less than
76 .\"O .IR x ,
77 .\"O these functions will return the largest representable number less than
78 .\"O .IR x .
79 .BR nextafter ()
80 ´Ø¿ô·²¤Ï¡¢\fIy\fP ¤Ë¸þ¤«¤¦Êý¸þ¤Ç \fIx\fP ¤Î¤¹¤°¼¡¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤òÊÖ¤¹¡£
81 .I y
82 ¤¬
83 .I x
84 ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢
85 .I x
86 ¤è¤ê¾®¤µ¤¤ºÇÂç¤ÎÉâÆ°¾®¿ôÅÀɽ¸½¤ÎÃͤòÊÖ¤¹¡£
87
88 .\"O If \fIx\fP equals \fIy\fP, the functions return \fIy\fP.
89 \fIx\fP ¤¬ \fIy\fP ¤ÈÅù¤·¤¤¾ì¹ç¡¢\fIy\fP ¤¬ÊÖ¤µ¤ì¤ë¡£
90
91 .\"O The
92 .\"O .BR nexttoward ()
93 .\"O functions do the same as the
94 .\"O .BR nextafter ()
95 .\"O functions, except that they have a
96 .\"O .I "long double"
97 .\"O second argument.
98 .BR nexttoward ()
99 ´Ø¿ô·²¤Ï¡¢2 ÈÖÌܤΰú¤­¿ô¤¬
100 .I long double
101 ·¿¤Ç¤¢¤ëÅÀ°Ê³°¡¢
102 .BR nextafter ()
103 ´Ø¿ô·²¤ÈƱ¤¸¤Ï¤¿¤é¤­¤ò¤¹¤ë¡£
104 .\"O .SH RETURN VALUE
105 .SH ÊÖ¤êÃÍ
106 .\"O On success,
107 .\"O these functions return the next representable floating-point value after
108 .\"O .I x
109 .\"O in the direction of
110 .\"O .IR y .
111 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIy\fP ¤Ë¸þ¤«¤¦Êý¸þ¤Ç \fIx\fP ¤Î
112 ¤¹¤°¼¡¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤òÊÖ¤¹¡£
113
114 .\"O If
115 .\"O .I x
116 .\"O equals
117 .\"O .IR y ,
118 .\"O then
119 .\"O .I y
120 .\"O (cast to the same type as
121 .\"O .IR x )
122 .\"O is returned.
123 .I x
124 ¤¬
125 .I y
126 ¤ÈÅù¤·¤¤¾ì¹ç¡¢
127 .RI ( x
128 ¤ÈƱ¤¸·¿¤Ë¥­¥ã¥¹¥È¤µ¤ì¤¿)
129 .I y
130 ¤¬ÊÖ¤µ¤ì¤ë¡£
131
132 .\"O If
133 .\"O .I x
134 .\"O or
135 .\"O .I y
136 .\"O is a NaN,
137 .\"O a NaN is returned.
138 .I x
139 ¤«
140 .I y
141 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
142
143 .\"O If
144 .\"O .I x
145 .\"O is finite,
146 .I x
147 ¤¬Í­¸ÂÃͤÇ
148 .\" e.g., DBL_MAX
149 .\"O and the result would overflow,
150 .\"O a range error occurs,
151 .\"O and the functions return
152 .\"O .BR HUGE_VAL ,
153 .\"O .BR HUGE_VALF ,
154 .\"O or
155 .\"O .BR HUGE_VALL ,
156 .\"O respectively, with the correct mathematical sign.
157 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢
158 ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
159 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
160 .BR HUGE_VAL ,
161 .BR HUGE_VALF ,
162 .B HUGE_VALL
163 ¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
164
165 .\"O If
166 .\"O .I x
167 .\"O is not equal to
168 .\"O .IR y ,
169 .\"O and the correct function result would be subnormal, zero, or underflow,
170 .\"O a range error occurs,
171 .\"O and either the correct value (if it can be represented),
172 .\"O or 0.0, is returned.
173 .I x
174 ¤¬
175 .I y
176 ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¯¡¢Àµ¤·¤¤´Ø¿ô¤Î·ë²Ì¤¬ÈóÀµµ¬²½¿ô¤«¥¼¥í¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¾ì¹ç¡¢
177 ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢
178 (ɽ¸½²Äǽ¤Ê¾ì¹ç¤Ë¤Ï) Àµ¤·¤¤Ãͤ¬¡¢(¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï) 0.0 ¤¬ÊÖ¤µ¤ì¤ë¡£
179 .\"O .SH ERRORS
180 .SH ¥¨¥é¡¼
181 .\"O See
182 .\"O .BR math_error (7)
183 .\"O for information on how to determine whether an error has occurred
184 .\"O when calling these functions.
185 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
186 .BR math_error (7)
187 ¤ò»²¾È¤Î¤³¤È¡£
188 .PP
189 .\"O The following errors can occur:
190 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
191 .TP
192 .\"O Range error: result overflow
193 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
194 .\" e.g., nextafter(DBL_MAX, HUGE_VAL);
195 .\" .I errno
196 .\" is set to
197 .\" .BR ERANGE .
198 .\"O An overflow floating-point exception
199 .\"O .RB ( FE_OVERFLOW )
200 .\"O is raised.
201 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
202 .RB ( FE_OVERFLOW )
203 ¤¬¾å¤¬¤ë¡£
204 .TP
205 .\"O Range error: result is subnormal or underflows
206 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬ÈóÀµµ¬²½¿ô¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼
207 .\" e.g., nextafter(DBL_MIN, 0.0);
208 .\" .I errno
209 .\" is set to
210 .\" .BR ERANGE .
211 .\"O An underflow floating-point exception
212 .\"O .RB ( FE_UNDERFLOW )
213 .\"O is raised.
214 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
215 .RB ( FE_UNDERFLOW )
216 ¤¬¾å¤¬¤ë¡£
217 .PP
218 .\"O These functions do not set
219 .\"O .IR errno .
220 ¤³¤ì¤é¤Î´Ø¿ô¤Ï
221 .I errno
222 ¤òÀßÄꤷ¤Ê¤¤¡£
223 .\" FIXME . Is it intentional that these functions do not set errno?
224 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6799
225 .\"O .SH "CONFORMING TO"
226 .SH ½àµò
227 C99, POSIX.1-2001.
228 .\"O This function is defined in IEC 559 (and the appendix with
229 .\"O recommended functions in IEEE 754/IEEE 854).
230 ¤³¤Î´Ø¿ô¤Ï IEC 559 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
231 (¤Þ¤¿ IEEE 754/IEEE 854 ¤Ç¤ÏÉÕÏ¿¤Ç¿ä¾©´Ø¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë)
232 .\"O .SH BUGS
233 .SH ¥Ð¥°
234 .\"O In glibc version 2.5 and earlier, these functions do not raise an underflow
235 .\"O floating-point
236 .\"O .RB ( FE_UNDERFLOW )
237 .\"O exception when an underflow occurs.
238 glibc ¥Ð¡¼¥¸¥ç¥ó 2.5 °ÊÁ°¤Ç¤Ï¡¢¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë¡¢
239 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
240 .RB ( FE_UNDERFLOW )
241 ¤ò¾å¤¬¤Ê¤¤¡£
242 .\"O .SH "SEE ALSO"
243 .SH ´ØÏ¢¹àÌÜ
244 .BR nearbyint (3)