aboutsummaryrefslogtreecommitdiff
path: root/math/pow.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2018-06-19 13:53:40 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2018-06-20 10:18:41 +0100
commite00696aadb1b0373b4d8993404e8202bb13f9d7e (patch)
treedc65531ca81c6ec60f64e9d384569c38540c03db /math/pow.c
parent2117b83270c9cab565e479d0ab433c428a72b16a (diff)
downloadarm-optimized-routines-e00696aadb1b0373b4d8993404e8202bb13f9d7e.tar.gz
Fix the sign of 0 in pow even with !WANT_ROUNDING
The sign needs to be fixed even in nearest rounding mode.
Diffstat (limited to 'math/pow.c')
-rw-r--r--math/pow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/math/pow.c b/math/pow.c
index e118737..dd7ff00 100644
--- a/math/pow.c
+++ b/math/pow.c
@@ -166,8 +166,8 @@ specialcase (double_t tmp, uint64_t sbits, uint64_t ki)
hi = one + y;
lo = one - hi + y + lo;
y = eval_as_double (hi + lo) - one;
- /* Avoid -0.0 with downward rounding. */
- if (WANT_ROUNDING && y == 0.0)
+ /* Fix the sign of 0. */
+ if (y == 0.0)
y = asdouble (sbits & 0x8000000000000000);
/* The underflow exception needs to be signaled explicitly. */
force_eval_double (opt_barrier_double (0x1p-1022) * 0x1p-1022);