about summary refs log tree commit diff
path: root/manual
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
parentf45eb078922a5c64343a8da2d17fec54c27f8704 (diff)
downloadglibc-41a359e22f3a85a570bd5fd94496d02959fe8394.tar.gz
glibc-41a359e22f3a85a570bd5fd94496d02959fe8394.tar.xz
glibc-41a359e22f3a85a570bd5fd94496d02959fe8394.zip
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')
-rw-r--r--manual/arith.texi40
-rwxr-xr-xmanual/libm-err-tab.pl6
2 files changed, 43 insertions, 3 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
diff --git a/manual/libm-err-tab.pl b/manual/libm-err-tab.pl
index 3846afcb2a..c2792c50d8 100755
--- a/manual/libm-err-tab.pl
+++ b/manual/libm-err-tab.pl
@@ -73,9 +73,9 @@ use vars qw (%results @all_floats %suffices @all_functions);
     "fmax", "fmin", "fmod", "frexp", "gamma", "hypot",
     "ilogb", "j0", "j1", "jn", "lgamma", "lrint",
     "llrint", "log", "log10", "log1p", "log2", "logb", "lround",
-    "llround", "modf", "nearbyint", "nextafter", "nexttoward", "pow",
-    "remainder", "remquo", "rint", "round", "scalb", "scalbn", "scalbln",
-    "sin", "sincos", "sinh", "sqrt", "tan", "tanh", "tgamma",
+    "llround", "modf", "nearbyint", "nextafter", "nextdown", "nexttoward",
+    "nextup", "pow", "remainder", "remquo", "rint", "round", "scalb",
+    "scalbn", "sin", "sincos", "sinh", "sqrt", "tan", "tanh", "tgamma",
     "trunc", "y0", "y1", "yn" );
 # fpclassify, isnormal, isfinite, isinf, isnan, issignaling, signbit,
 # isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered