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
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>
11 .\"WORD: mantissa ²¾¿ôÉô
12 .\"WORD: normalized Àµµ¬²½¤µ¤ì¤¿
13 .\"WORD: subnormal ÈóÀµµ¬²½¤Î
15 .TH NEXTAFTER 3 2009-12-05 "GNU" "Linux Programmer's Manual"
17 .\"O nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \-
18 .\"O floating-point number manipulation
20 nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \-
26 .BI "double nextafter(double " x ", double " y );
28 .BI "float nextafterf(float " x ", float " y );
30 .BI "long double nextafterl(long double " x ", long double " y );
32 .BI "double nexttoward(double " x ", long double " y );
34 .BI "float nexttowardf(float " x ", long double " y );
36 .BI "long double nexttowardl(long double " x ", long double " y );
38 .\"O Link with \fI\-lm\fP.
39 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
42 .\"O Feature Test Macro Requirements for glibc (see
43 .\"O .BR feature_test_macros (7)):
44 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
45 .RB ( feature_test_macros (7)
51 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or
56 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
62 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE;
69 .\"O functions return the next representable floating-point value following
71 .\"O in the direction of
77 .\"O these functions will return the largest representable number less than
80 ´Ø¿ô·²¤Ï¡¢\fIy\fP ¤Ë¸þ¤«¤¦Êý¸þ¤Ç \fIx\fP ¤Î¤¹¤°¼¡¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤òÊÖ¤¹¡£
86 ¤è¤ê¾®¤µ¤¤ºÇÂç¤ÎÉâÆ°¾®¿ôÅÀɽ¸½¤ÎÃͤòÊÖ¤¹¡£
88 .\"O If \fIx\fP equals \fIy\fP, the functions return \fIy\fP.
89 \fIx\fP ¤¬ \fIy\fP ¤ÈÅù¤·¤¤¾ì¹ç¡¢\fIy\fP ¤¬ÊÖ¤µ¤ì¤ë¡£
92 .\"O .BR nexttoward ()
93 .\"O functions do the same as the
95 .\"O functions, except that they have a
99 ´Ø¿ô·²¤Ï¡¢2 ÈÖÌܤΰú¤¿ô¤¬
103 ´Ø¿ô·²¤ÈƱ¤¸¤Ï¤¿¤é¤¤ò¤¹¤ë¡£
104 .\"O .SH RETURN VALUE
107 .\"O these functions return the next representable floating-point value after
109 .\"O in the direction of
111 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIy\fP ¤Ë¸þ¤«¤¦Êý¸þ¤Ç \fIx\fP ¤Î
112 ¤¹¤°¼¡¤ÎÉâÆ°¾®¿ôÅÀ¿ôɽ¸½¤òÊÖ¤¹¡£
120 .\"O (cast to the same type as
128 ¤ÈƱ¤¸·¿¤Ë¥¥ã¥¹¥È¤µ¤ì¤¿)
137 .\"O a NaN is returned.
141 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
149 .\"O and the result would overflow,
150 .\"O a range error occurs,
151 .\"O and the functions return
156 .\"O respectively, with the correct mathematical sign.
157 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢
158 ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
163 ¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
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.
176 ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¯¡¢Àµ¤·¤¤´Ø¿ô¤Î·ë²Ì¤¬ÈóÀµµ¬²½¿ô¤«¥¼¥í¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¾ì¹ç¡¢
178 (ɽ¸½²Äǽ¤Ê¾ì¹ç¤Ë¤Ï) Àµ¤·¤¤Ãͤ¬¡¢(¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï) 0.0 ¤¬ÊÖ¤µ¤ì¤ë¡£
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 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
189 .\"O The following errors can occur:
190 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
192 .\"O Range error: result overflow
193 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
194 .\" e.g., nextafter(DBL_MAX, HUGE_VAL);
198 .\"O An overflow floating-point exception
199 .\"O .RB ( FE_OVERFLOW )
201 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
205 .\"O Range error: result is subnormal or underflows
206 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬ÈóÀµµ¬²½¿ô¤«¥¢¥ó¥À¡¼¥Õ¥í¡¼
207 .\" e.g., nextafter(DBL_MIN, 0.0);
211 .\"O An underflow floating-point exception
212 .\"O .RB ( FE_UNDERFLOW )
214 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
218 .\"O These functions do not set
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"
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 ¤Ç¤ÏÉÕÏ¿¤Ç¿ä¾©´Ø¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë)
234 .\"O In glibc version 2.5 and earlier, these functions do not raise an underflow
236 .\"O .RB ( FE_UNDERFLOW )
237 .\"O exception when an underflow occurs.
238 glibc ¥Ð¡¼¥¸¥ç¥ó 2.5 °ÊÁ°¤Ç¤Ï¡¢¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿ºÝ¤Ë¡¢
239 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°