Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/lib/libm/noieee_src Pull up revision 1.5 (requested by ...
details: https://anonhg.NetBSD.org/src/rev/ae8c1d779743
branches: netbsd-1-6
changeset: 527949:ae8c1d779743
user: lukem <lukem%NetBSD.org@localhost>
date: Tue Jun 18 13:38:54 2002 +0000
description:
Pull up revision 1.5 (requested by matt in ticket #286):
Ansify libm noieeesrc (for VAX). Also make const data really const.
libm for VAX can compiles with WARNS=2
diffstat:
lib/libm/noieee_src/n_exp__E.c | 7 ++++---
lib/libm/noieee_src/n_expm1.c | 20 +++++++++++---------
2 files changed, 15 insertions(+), 12 deletions(-)
diffs (80 lines):
diff -r e93f023f0f11 -r ae8c1d779743 lib/libm/noieee_src/n_exp__E.c
--- a/lib/libm/noieee_src/n_exp__E.c Tue Jun 18 13:38:45 2002 +0000
+++ b/lib/libm/noieee_src/n_exp__E.c Tue Jun 18 13:38:54 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_exp__E.c,v 1.4 1999/07/02 15:37:37 simonb Exp $ */
+/* $NetBSD: n_exp__E.c,v 1.4.10.1 2002/06/18 13:38:54 lukem Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -89,6 +89,7 @@
* shown.
*/
+#define _LIBM_STATIC
#include "mathimpl.h"
vc(p1, 1.5150724356786683059E-2 ,3abe,3d78,066a,67e1, -6, .F83ABE67E1066A)
@@ -110,8 +111,8 @@
#define q3 vccast(q3)
#endif
-double __exp__E(x,c)
-double x,c;
+double
+__exp__E(double x, double c)
{
const static double zero=0.0, one=1.0, half=1.0/2.0, small=1.0E-19;
double z,p,q,xp,xh,w;
diff -r e93f023f0f11 -r ae8c1d779743 lib/libm/noieee_src/n_expm1.c
--- a/lib/libm/noieee_src/n_expm1.c Tue Jun 18 13:38:45 2002 +0000
+++ b/lib/libm/noieee_src/n_expm1.c Tue Jun 18 13:38:54 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_expm1.c,v 1.4 1999/07/02 15:37:37 simonb Exp $ */
+/* $NetBSD: n_expm1.c,v 1.4.10.1 2002/06/18 13:39:03 lukem Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -89,6 +89,7 @@
* shown.
*/
+#define _LIBM_STATIC
#include "mathimpl.h"
vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000)
@@ -108,17 +109,18 @@
#define invln2 vccast(invln2)
#endif
-double expm1(x)
-double x;
+#if defined(__vax__)||defined(tahoe)
+#define PREC 56
+#else /* defined(__vax__)||defined(tahoe) */
+#define PREC 53
+#endif /* defined(__vax__)||defined(tahoe) */
+
+double
+expm1(double x)
{
const static double one=1.0, half=1.0/2.0;
double z,hi,lo,c;
int k;
-#if defined(__vax__)||defined(tahoe)
- static int prec=56;
-#else /* defined(__vax__)||defined(tahoe) */
- static int prec=53;
-#endif /* defined(__vax__)||defined(tahoe) */
#if !defined(__vax__)&&!defined(tahoe)
if(x!=x) return(x); /* x is NaN */
@@ -142,7 +144,7 @@
/* end of k=1 */
else {
- if(k<=prec)
+ if(k<=PREC)
{ x=one-scalb(one,-k); z += __exp__E(z,c);}
else if(k<100)
{ x = __exp__E(z,c)-scalb(one,-k); x+=z; z=one;}
Home |
Main Index |
Thread Index |
Old Index