Source-Changes-HG archive

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

[src/trunk]: src/lib/libm/src PR/42630 asin(2.0) and acos(2.0) doesn't return...



details:   https://anonhg.NetBSD.org/src/rev/908b3a3ed2ff
branches:  trunk
changeset: 750983:908b3a3ed2ff
user:      tnozaki <tnozaki%NetBSD.org@localhost>
date:      Wed Jan 20 16:31:35 2010 +0000

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

diffstat:

 lib/libm/src/k_standard.c |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r cf92537aad5a -r 908b3a3ed2ff lib/libm/src/k_standard.c
--- a/lib/libm/src/k_standard.c Wed Jan 20 15:45:52 2010 +0000
+++ b/lib/libm/src/k_standard.c Wed Jan 20 16:31:35 2010 +0000
@@ -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);
                      }



Home | Main Index | Thread Index | Old Index