Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libm/noieee_src avoid negative shift



details:   https://anonhg.NetBSD.org/src/rev/10f2aec61e3e
branches:  trunk
changeset: 321188:10f2aec61e3e
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 06 01:14:41 2018 +0000

description:
avoid negative shift

diffstat:

 lib/libm/noieee_src/n_exp2.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r d44c92e918f2 -r 10f2aec61e3e lib/libm/noieee_src/n_exp2.c
--- a/lib/libm/noieee_src/n_exp2.c      Tue Mar 06 00:15:24 2018 +0000
+++ b/lib/libm/noieee_src/n_exp2.c      Tue Mar 06 01:14:41 2018 +0000
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: n_exp2.c,v 1.3 2014/03/23 15:26:47 martin Exp $");
+__RCSID("$NetBSD: n_exp2.c,v 1.4 2018/03/06 01:14:41 christos Exp $");
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: src/lib/msun/src/s_exp2.c,v 1.7 2008/02/22 02:27:34 das Exp $");
 #endif
@@ -372,7 +372,8 @@
        /* Compute r = exp2(y) = exp2t[i0] * p(z - eps[i]). */
        t = tbl[i0];            /* exp2t[i0] */
        z -= tbl[i0 + 1];       /* eps[i0]   */
-       big = k >= -1021 << 20;
+       /* -1021 << 20 == 3075 << 20 */
+       big = k >= 3075 << 20;
        if (big) {
                temp = 0x3ff00000+k;
                twopk = 0.0;



Home | Main Index | Thread Index | Old Index