Module Name: src
Committed By: christos
Date: Sat Aug 27 10:00:38 UTC 2016
Modified Files:
src/lib/libm/src: k_standard.c
Log Message:
correct case 23 for -0.0
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libm/src/k_standard.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/k_standard.c
diff -u src/lib/libm/src/k_standard.c:1.20 src/lib/libm/src/k_standard.c:1.21
--- src/lib/libm/src/k_standard.c:1.20 Tue Sep 8 01:23:31 2015
+++ src/lib/libm/src/k_standard.c Sat Aug 27 06:00:38 2016
@@ -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 @@ __kernel_standard(double x, double y, in
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)) {