diff options
author | Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> | 2016-06-16 21:21:26 +0530 |
---|---|---|
committer | Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> | 2016-06-16 21:37:45 +0530 |
commit | 41a359e22f3a85a570bd5fd94496d02959fe8394 (patch) | |
tree | b07e8945a063a025f34f92e910bf8fb1e2e220d5 /math/tgmath.h | |
parent | f45eb078922a5c64343a8da2d17fec54c27f8704 (diff) | |
download | glibc-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 'math/tgmath.h')
-rw-r--r-- | math/tgmath.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/math/tgmath.h b/math/tgmath.h index ea2b611f15..8916fbe39c 100644 --- a/math/tgmath.h +++ b/math/tgmath.h @@ -392,6 +392,13 @@ prevailing rounding mode. */ #define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint) +#ifdef __USE_GNU +/* Return X - epsilon. */ +# define nextdown(Val) __TGMATH_UNARY_REAL_ONLY (Val, nextdown) +/* Return X + epsilon. */ +# define nextup(Val) __TGMATH_UNARY_REAL_ONLY (Val, nextup) +#endif + /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ #define nextafter(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, nextafter) #define nexttoward(Val1, Val2) \ |