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>
5 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
6 .\" Distributed under GPL
9 .\" Based on glibc infopages
11 .TH NEXTAFTER 3 2017-09-15 "GNU" "Linux Programmer's Manual"
13 nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \-
14 floating-point number manipulation
18 .BI "double nextafter(double " x ", double " y );
20 .BI "float nextafterf(float " x ", float " y );
22 .BI "long double nextafterl(long double " x ", long double " y );
24 .BI "double nexttoward(double " x ", long double " y );
26 .BI "float nexttowardf(float " x ", long double " y );
28 .BI "long double nexttowardl(long double " x ", long double " y );
33 Feature Test Macro Requirements for glibc (see
34 .BR feature_test_macros (7)):
40 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
41 || _XOPEN_SOURCE\ >=\ 500
42 .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
43 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
44 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
50 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
51 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
52 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
59 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
60 _POSIX_C_SOURCE\ >=\ 200112L
69 functions return the next representable floating-point value following
77 these functions will return the largest representable number less than
92 functions do the same as the corresponding
94 functions, except that they have a
99 these functions return the next representable floating-point value after
110 (cast to the same type as
125 and the result would overflow,
126 a range error occurs,
127 and the functions return
132 respectively, with the correct mathematical sign.
138 and the correct function result would be subnormal, zero, or underflow,
139 a range error occurs,
140 and either the correct value (if it can be represented),
145 for information on how to determine whether an error has occurred
146 when calling these functions.
148 The following errors can occur:
150 Range error: result overflow
151 .\" e.g., nextafter(DBL_MAX, HUGE_VAL);
155 An overflow floating-point exception
159 Range error: result is subnormal or underflows
160 .\" e.g., nextafter(DBL_MIN, 0.0);
164 An underflow floating-point exception
168 These functions do not set
170 .\" FIXME . Is it intentional that these functions do not set errno?
171 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6799
173 For an explanation of the terms used in this section, see
179 Interface Attribute Value
189 T} Thread safety MT-Safe
192 C99, POSIX.1-2001, POSIX.1-2008.
193 This function is defined in IEC 559 (and the appendix with
194 recommended functions in IEEE 754/IEEE 854).
196 In glibc version 2.5 and earlier, these functions do not raise an underflow
199 exception when an underflow occurs.