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 .TH NEXTAFTER 3 2009-12-05 "GNU" "Linux Programmer's Manual"
8 nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \-
9 floating-point number manipulation
13 .BI "double nextafter(double " x ", double " y );
15 .BI "float nextafterf(float " x ", float " y );
17 .BI "long double nextafterl(long double " x ", long double " y );
19 .BI "double nexttoward(double " x ", long double " y );
21 .BI "float nexttowardf(float " x ", long double " y );
23 .BI "long double nexttowardl(long double " x ", long double " y );
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
34 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or
39 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
45 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE;
51 functions return the next representable floating-point value following
59 these functions will return the largest representable number less than
62 If \fIx\fP equals \fIy\fP, the functions return \fIy\fP.
66 functions do the same as the
68 functions, except that they have a
73 these functions return the next representable floating-point value after
84 (cast to the same type as
99 and the result would overflow,
100 a range error occurs,
101 and the functions return
106 respectively, with the correct mathematical sign.
112 and the correct function result would be subnormal, zero, or underflow,
113 a range error occurs,
114 and either the correct value (if it can be represented),
119 for information on how to determine whether an error has occurred
120 when calling these functions.
122 The following errors can occur:
124 Range error: result overflow
125 .\" e.g., nextafter(DBL_MAX, HUGE_VAL);
129 An overflow floating-point exception
133 Range error: result is subnormal or underflows
134 .\" e.g., nextafter(DBL_MIN, 0.0);
138 An underflow floating-point exception
142 These functions do not set
144 .\" FIXME . Is it intentional that these functions do not set errno?
145 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6799
148 This function is defined in IEC 559 (and the appendix with
149 recommended functions in IEEE 754/IEEE 854).
151 In glibc version 2.5 and earlier, these functions do not raise an underflow
154 exception when an underflow occurs.