diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2018-06-19 13:53:40 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2018-06-20 10:18:41 +0100 |
commit | e00696aadb1b0373b4d8993404e8202bb13f9d7e (patch) | |
tree | dc65531ca81c6ec60f64e9d384569c38540c03db /math/pow.c | |
parent | 2117b83270c9cab565e479d0ab433c428a72b16a (diff) | |
download | arm-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |