Module Name: src
Committed By: martin
Date: Wed Mar 12 19:42:18 UTC 2014
Modified Files:
src/lib/libm/noieee_src: n_exp2.c
Log Message:
XXX This is all wrong and needs new tables and constants - but at least use
constants in the VAX double range for now, so it is compilable with newer
gcc.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/noieee_src/n_exp2.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/noieee_src/n_exp2.c
diff -u src/lib/libm/noieee_src/n_exp2.c:1.1 src/lib/libm/noieee_src/n_exp2.c:1.2
--- src/lib/libm/noieee_src/n_exp2.c:1.1 Thu Mar 6 10:55:57 2014
+++ src/lib/libm/noieee_src/n_exp2.c Wed Mar 12 19:42:18 2014
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: n_exp2.c,v 1.1 2014/03/06 10:55:57 martin Exp $");
+__RCSID("$NetBSD: n_exp2.c,v 1.2 2014/03/12 19:42:18 martin Exp $");
#ifdef __FBSDID
__FBSDID("$FreeBSD: src/lib/msun/src/s_exp2.c,v 1.7 2008/02/22 02:27:34 das Exp $");
#endif
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD: src/lib/msun/src/s_e
#define TBLSIZE (1 << TBLBITS)
static const double
- huge = 0x1p1000,
+ huge = 0x1p126,
redux = 0x1.8p52 / TBLSIZE,
P1 = 0x1.62e42fefa39efp-1,
P2 = 0x1.ebfbdff82c575p-3,
@@ -47,7 +47,7 @@ static const double
P4 = 0x1.3b2ab88f70400p-7,
P5 = 0x1.5d88003875c74p-10;
-static volatile double twom1000 = 0x1p-1000;
+static volatile double twom1000 = 0x1p-100;
static const double tbl[TBLSIZE * 2] = {
/* exp2(z + eps) eps */
@@ -383,8 +383,8 @@ exp2(double x)
/* Scale by 2**(k>>20). */
if (big) {
- if (k == 1024 << 20)
- return (r * 2.0 * 0x1p1023);
+ /*if (k == 1024 << 20)
+ return (r * 2.0 * 0x1p1023); */
return (r * twopk);
} else {
return (r * twopk * twom1000);