Source-Changes-HG archive

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

[src/trunk]: src/lib/libm/src Try to fix bogus underflow test (obvious copy &...



details:   https://anonhg.NetBSD.org/src/rev/c58b70e5f2d6
branches:  trunk
changeset: 786901:c58b70e5f2d6
user:      martin <martin%NetBSD.org@localhost>
date:      Sun May 19 20:50:02 2013 +0000

description:
Try to fix bogus underflow test (obvious copy & pasto) - someone please
review to make sure I got it right.
This fixes PR 47834.

diffstat:

 lib/libm/src/s_scalbnl.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c8a1cabdc2ea -r c58b70e5f2d6 lib/libm/src/s_scalbnl.c
--- a/lib/libm/src/s_scalbnl.c  Sun May 19 20:45:34 2013 +0000
+++ b/lib/libm/src/s_scalbnl.c  Sun May 19 20:50:02 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: s_scalbnl.c,v 1.7 2013/04/28 14:46:16 joerg Exp $      */
+/*     $NetBSD: s_scalbnl.c,v 1.8 2013/05/19 20:50:02 martin Exp $     */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: s_scalbnl.c,v 1.7 2013/04/28 14:46:16 joerg Exp $");
+__RCSID("$NetBSD: s_scalbnl.c,v 1.8 2013/05/19 20:50:02 martin Exp $");
 
 #include "namespace.h"
 
@@ -82,7 +82,7 @@
        /* Protect against integer overflow in calculation of new exponent */
        if (n > LDBL_MAX_EXP - LDBL_MIN_EXP + LDBL_MANT_DIG)
                goto overflow;
-       if (n < LDBL_MAX_EXP - LDBL_MIN_EXP + LDBL_MANT_DIG)
+       if (n < LDBL_MIN_EXP - LDBL_MAX_EXP - LDBL_MANT_DIG)
                goto underflow;
 
        /* Scale denormalized numbers slightly, so that they are normal */



Home | Main Index | Thread Index | Old Index