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/test-tgmath.c | |
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/test-tgmath.c')
-rw-r--r-- | math/test-tgmath.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/math/test-tgmath.c b/math/test-tgmath.c index 0e978d17c4..70ab42881a 100644 --- a/math/test-tgmath.c +++ b/math/test-tgmath.c @@ -50,7 +50,7 @@ int count_cdouble; int count_cfloat; int count_cldouble; -#define NCALLS 115 +#define NCALLS 119 #define NCALLS_INT 4 #define NCCALLS 47 @@ -274,7 +274,9 @@ F(compile_test) (void) b = lgamma (lgamma (a)); a = rint (rint (x)); b = nextafter (nextafter (a, b), nextafter (c, x)); - a = nexttoward (nexttoward (x, a), c); + a = nextdown (nextdown (a)); + b = nexttoward (nexttoward (x, a), c); + a = nextup (nextup (a)); b = remainder (remainder (a, b), remainder (c, x)); a = scalb (scalb (x, a), (TYPE) (6)); k = scalbn (a, 7) + scalbln (c, 10l); @@ -777,6 +779,14 @@ TYPE } TYPE +(F(nextdown)) (TYPE x) +{ + ++count; + P (); + return x; +} + +TYPE (F(nexttoward)) (TYPE x, long double y) { ++count; @@ -785,6 +795,14 @@ TYPE } TYPE +(F(nextup)) (TYPE x) +{ + ++count; + P (); + return x; +} + +TYPE (F(remainder)) (TYPE x, TYPE y) { ++count; |