summaryrefslogtreecommitdiff
path: root/manual/arith.texi
diff options
context:
space:
mode:
authorRajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>2016-06-16 21:21:26 +0530
committerRajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>2016-06-16 21:37:45 +0530
commit41a359e22f3a85a570bd5fd94496d02959fe8394 (patch)
treeb07e8945a063a025f34f92e910bf8fb1e2e220d5 /manual/arith.texi
parentf45eb078922a5c64343a8da2d17fec54c27f8704 (diff)
Add nextup and nextdown math functions
TS 18661 adds nextup and nextdown functions alongside nextafter to provide support for float128 equivalent to it. This patch adds nextupl, nextup, nextupf, nextdownl, nextdown and nextdownf to libm before float128 support. The nextup functions return the next representable value in the direction of positive infinity and the nextdown functions return the next representable value in the direction of negative infinity. These are currently enabled as GNU extensions.
Diffstat (limited to 'manual/arith.texi')
-rw-r--r--manual/arith.texi40
1 files changed, 40 insertions, 0 deletions
diff --git a/manual/arith.texi b/manual/arith.texi
index 72682f0c99..f54b1ec7df 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -1702,6 +1702,46 @@ These functions are identical to the corresponding versions of
double}.
@end deftypefun
+@comment math.h
+@comment GNU
+@deftypefun double nextup (double @var{x})
+@comment math.h
+@comment GNU
+@deftypefunx float nextupf (float @var{x})
+@comment math.h
+@comment GNU
+@deftypefunx {long double} nextupl (long double @var{x})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+The @code{nextup} function returns the next representable neighbor of @var{x}
+in the direction of positive infinity. If @var{x} is the smallest negative
+subnormal number in the type of @var{x} the function returns @code{-0}. If
+@math{@var{x} = @code{0}} the function returns the smallest positive subnormal
+number in the type of @var{x}. If @var{x} is NaN, NaN is returned.
+If @var{x} is @math{+@infinity{}}, @math{+@infinity{}} is returned.
+@code{nextup} is based on TS 18661 and currently enabled as a GNU extension.
+@code{nextup} never raises an exception except for signaling NaNs.
+@end deftypefun
+
+@comment math.h
+@comment GNU
+@deftypefun double nextdown (double @var{x})
+@comment math.h
+@comment GNU
+@deftypefunx float nextdownf (float @var{x})
+@comment math.h
+@comment GNU
+@deftypefunx {long double} nextdownl (long double @var{x})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+The @code{nextdown} function returns the next representable neighbor of @var{x}
+in the direction of negative infinity. If @var{x} is the smallest positive
+subnormal number in the type of @var{x} the function returns @code{+0}. If
+@math{@var{x} = @code{0}} the function returns the smallest negative subnormal
+number in the type of @var{x}. If @var{x} is NaN, NaN is returned.
+If @var{x} is @math{-@infinity{}}, @math{-@infinity{}} is returned.
+@code{nextdown} is based on TS 18661 and currently enabled as a GNU extension.
+@code{nextdown} never raises an exception except for signaling NaNs.
+@end deftypefun
+
@cindex NaN
@comment math.h
@comment ISO