Source-Changes-HG archive

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

[src/trunk]: src/lib/libm/src correct case 23 for -0.0



details:   https://anonhg.NetBSD.org/src/rev/303a08c32450
branches:  trunk
changeset: 817615:303a08c32450
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Aug 27 10:00:38 2016 +0000

description:
correct case 23 for -0.0

diffstat:

 lib/libm/src/k_standard.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 3155d9ec5d5d -r 303a08c32450 lib/libm/src/k_standard.c
--- a/lib/libm/src/k_standard.c Sat Aug 27 09:35:13 2016 +0000
+++ b/lib/libm/src/k_standard.c Sat Aug 27 10:00:38 2016 +0000
@@ -12,12 +12,13 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: k_standard.c,v 1.20 2015/09/08 05:23:31 dholland Exp $");
+__RCSID("$NetBSD: k_standard.c,v 1.21 2016/08/27 10:00:38 christos Exp $");
 #endif
 
 #include "math.h"
 #include "math_private.h"
 #include <errno.h>
+#include <stdio.h>
 
 #ifndef _USE_WRITE
 #include <stdio.h>                     /* fputs(), stderr */
@@ -468,8 +469,11 @@
                exc.name = type < 100 ? "pow" : "powf";
                if (_LIB_VERSION == _SVID_)
                  exc.retval = zero;
-               else
+               else {
                  exc.retval = HUGE_VAL;
+                 y *= 0.5;
+                 if(signbit(x)&&rint(y)!=y) exc.retval = -HUGE_VAL;
+               }
                if (_LIB_VERSION == _POSIX_)
                  errno = EDOM;
                else if (!matherr(&exc)) {



Home | Main Index | Thread Index | Old Index