CVS commit: [netbsd-5] src/lib/libm/src

2015-11-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Nov  7 20:25:23 UTC 2015

Modified Files:
src/lib/libm/src [netbsd-5]: lrint.c lrintf.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #1972):
lib/libm/src/lrintf.c: revision 1.6
lib/libm/src/lrint.c: revision 1.5
Return x for >= DBL_FRACBITS in lrint.c.
Return x for >= SNG_FRACBITS in lrintf.c
Addresses PR lib/49690
This commit was approved by christos@


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.6.1 src/lib/libm/src/lrint.c
cvs rdiff -u -r1.5 -r1.5.6.1 src/lib/libm/src/lrintf.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/lrint.c
diff -u src/lib/libm/src/lrint.c:1.4 src/lib/libm/src/lrint.c:1.4.6.1
--- src/lib/libm/src/lrint.c:1.4	Sat Apr 26 23:49:50 2008
+++ src/lib/libm/src/lrint.c	Sat Nov  7 20:25:23 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lrint.c,v 1.4 2008/04/26 23:49:50 christos Exp $ */
+/* $NetBSD: lrint.c,v 1.4.6.1 2015/11/07 20:25:23 snj Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -70,7 +70,8 @@ LRINTNAME(double x)
 		/* round, using current direction */
 		x += TWO52[s];
 		x -= TWO52[s];
-	}
+	} else
+		return x;
 
 	EXTRACT_WORDS(i0, i1, x);
 	e = ((i0 >> 20) & 0x7ff) - DBL_EXP_BIAS;

Index: src/lib/libm/src/lrintf.c
diff -u src/lib/libm/src/lrintf.c:1.5 src/lib/libm/src/lrintf.c:1.5.6.1
--- src/lib/libm/src/lrintf.c:1.5	Sat Apr 26 23:49:50 2008
+++ src/lib/libm/src/lrintf.c	Sat Nov  7 20:25:23 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lrintf.c,v 1.5 2008/04/26 23:49:50 christos Exp $ */
+/* $NetBSD: lrintf.c,v 1.5.6.1 2015/11/07 20:25:23 snj Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -74,7 +74,8 @@ LRINTNAME(float x)
 		/* round, using current direction */
 		w = TWO23[s] + x;
 		x = w - TWO23[s];
-	}
+	} else
+		return x;
 
 	GET_FLOAT_WORD(i0, x);
 	e = ((i0 >> SNG_FRACBITS) & 0xff) - SNG_EXP_BIAS;



CVS commit: [netbsd-5] src/lib/libm/src

2010-01-23 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jan 23 18:02:33 UTC 2010

Modified Files:
src/lib/libm/src [netbsd-5]: k_standard.c

Log Message:
Pull up following revision(s) (requested by tnozaki in ticket #1261):
lib/libm/src/k_standard.c: revision 1.13, 1.14
PR/42630 asin(2.0) and acos(2.0) doesn't return NaN.
reported by NARUSE, Yui -san, Thanks!
let the previous fix apply to acos rather than atan2,
and get rid of #ifdef vax


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.26.1 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.12.26.1
--- src/lib/libm/src/k_standard.c:1.12	Thu Jul 21 16:58:39 2005
+++ src/lib/libm/src/k_standard.c	Sat Jan 23 18:02:33 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.12.26.1 2010/01/23 18:02:33 bouyer Exp $);
 #endif
 
 #include math.h
@@ -103,9 +103,10 @@
 		exc.type = DOMAIN;
 		exc.name = type  100 ? acos : acosf;
 		exc.retval = zero;
-		if (_LIB_VERSION == _POSIX_)
+		if (_LIB_VERSION == _POSIX_) {
+		  exc.retval = zero/zero;
 		  errno = EDOM;
-		else if (!matherr(exc)) {
+		} else if (!matherr(exc)) {
 		  if(_LIB_VERSION == _SVID_) {
 		(void) WRITE2(acos: DOMAIN error\n, 19);
 		  }
@@ -118,9 +119,10 @@
 		exc.type = DOMAIN;
 		exc.name = type  100 ? asin : asinf;
 		exc.retval = zero;
-		if(_LIB_VERSION == _POSIX_)
+		if(_LIB_VERSION == _POSIX_) {
+		  exc.retval = zero/zero;
 		  errno = EDOM;
-		else if (!matherr(exc)) {
+		} else if (!matherr(exc)) {
 		  if(_LIB_VERSION == _SVID_) {
 			(void) WRITE2(asin: DOMAIN error\n, 19);
 		  }