Module Name:    src
Committed By:   martin
Date:           Sun May 19 20:50:02 UTC 2013

Modified Files:
        src/lib/libm/src: s_scalbnl.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_scalbnl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_scalbnl.c
diff -u src/lib/libm/src/s_scalbnl.c:1.7 src/lib/libm/src/s_scalbnl.c:1.8
--- src/lib/libm/src/s_scalbnl.c:1.7	Sun Apr 28 14:46:16 2013
+++ src/lib/libm/src/s_scalbnl.c	Sun May 19 20:50:02 2013
@@ -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 @@ scalblnl(long double x, long n)
 	/* 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 */

Reply via email to