summaryrefslogtreecommitdiff
path: root/lib/libm/src
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2016-08-27 10:00:38 +0000
committerchristos <christos@NetBSD.org>2016-08-27 10:00:38 +0000
commitce6273672ca87ce7fefbfe9dbbd652147d72d5d3 (patch)
treea1d104b837b568dce7c11d95c998766c9fb2b258 /lib/libm/src
parentc98f3fb98d085c83ebe1ee8e67cc79ba1b137284 (diff)
correct case 23 for -0.0
Diffstat (limited to 'lib/libm/src')
-rw-r--r--lib/libm/src/k_standard.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libm/src/k_standard.c b/lib/libm/src/k_standard.c
index 5dac9a23935..3cb99263ad6 100644
--- a/lib/libm/src/k_standard.c
+++ b/lib/libm/src/k_standard.c
@@ -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, int type)
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)) {