Module Name:    src
Committed By:   tnozaki
Date:           Wed Jan 20 16:31:35 UTC 2010

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

Log Message:
PR/42630 asin(2.0) and acos(2.0) doesn't return NaN.
reported by NARUSE, Yui -san, Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.12 src/lib/libm/src/k_standard.c:1.13
--- src/lib/libm/src/k_standard.c:1.12	Thu Jul 21 16:58:39 2005
+++ src/lib/libm/src/k_standard.c	Wed Jan 20 16:31:35 2010
@@ -12,7 +12,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: k_standard.c,v 1.12 2005/07/21 16:58:39 christos Exp $");
+__RCSID("$NetBSD: k_standard.c,v 1.13 2010/01/20 16:31:35 tnozaki Exp $");
 #endif
 
 #include "math.h"
@@ -118,9 +118,12 @@
 		exc.type = DOMAIN;
 		exc.name = type < 100 ? "asin" : "asinf";
 		exc.retval = zero;
-		if(_LIB_VERSION == _POSIX_)
+		if(_LIB_VERSION == _POSIX_) {
+#ifndef __vax__
+		  exc.retval = NAN;
+#endif
 		  errno = EDOM;
-		else if (!matherr(&exc)) {
+		} else if (!matherr(&exc)) {
 		  if(_LIB_VERSION == _SVID_) {
 		    	(void) WRITE2("asin: DOMAIN error\n", 19);
 		  }
@@ -135,9 +138,12 @@
 		exc.type = DOMAIN;
 		exc.name = type < 100 ? "atan2" : "atan2f";
 		exc.retval = zero;
-		if(_LIB_VERSION == _POSIX_)
+		if(_LIB_VERSION == _POSIX_) {
+#ifndef __vax__
+		  exc.retval = NAN;
+#endif
 		  errno = EDOM;
-		else if (!matherr(&exc)) {
+		} else if (!matherr(&exc)) {
 		  if(_LIB_VERSION == _SVID_) {
 			(void) WRITE2("atan2: DOMAIN error\n", 20);
 		      }

Reply via email to