From 41a359e22f3a85a570bd5fd94496d02959fe8394 Mon Sep 17 00:00:00 2001 From: Rajalakshmi Srinivasaraghavan Date: Thu, 16 Jun 2016 21:21:26 +0530 Subject: 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. --- math/bits/mathcalls.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'math/bits') diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index 9a7b3f0..e2cf49f 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -294,6 +294,13 @@ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif +#ifdef __USE_GNU +/* Return X - epsilon. */ +__MATHCALL (nextdown,, (_Mdouble_ __x)); +/* Return X + epsilon. */ +__MATHCALL (nextup,, (_Mdouble_ __x)); +# endif + /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); -- cgit v1.1