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/1a9c8bf91df6
branches: netbsd-1-6
changeset: 527958:1a9c8bf91df6
user: lukem <lukem%NetBSD.org@localhost>
date: Tue Jun 18 13:41:42 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_tanh.c | 8 ++++----
lib/libm/noieee_src/trig.h | 37 +++++++++++++++++++++++++------------
2 files changed, 29 insertions(+), 16 deletions(-)
diffs (74 lines):
diff -r 2cb9a3235919 -r 1a9c8bf91df6 lib/libm/noieee_src/n_tanh.c
--- a/lib/libm/noieee_src/n_tanh.c Tue Jun 18 13:41:24 2002 +0000
+++ b/lib/libm/noieee_src/n_tanh.c Tue Jun 18 13:41:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_tanh.c,v 1.4 1999/07/02 15:37:37 simonb Exp $ */
+/* $NetBSD: n_tanh.c,v 1.4.10.1 2002/06/18 13:41:42 lukem Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -77,10 +77,10 @@
#include "mathimpl.h"
-double tanh(x)
-double x;
+double
+tanh(double x)
{
- static double one=1.0, two=2.0, small = 1.0e-10, big = 1.0e10;
+ static const double one=1.0, two=2.0, small = 1.0e-10, big = 1.0e10;
double t, sign;
#if !defined(__vax__)&&!defined(tahoe)
diff -r 2cb9a3235919 -r 1a9c8bf91df6 lib/libm/noieee_src/trig.h
--- a/lib/libm/noieee_src/trig.h Tue Jun 18 13:41:24 2002 +0000
+++ b/lib/libm/noieee_src/trig.h Tue Jun 18 13:41:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trig.h,v 1.4 1999/07/02 15:37:37 simonb Exp $ */
+/* $NetBSD: trig.h,v 1.4.10.1 2002/06/18 13:41:51 lukem Exp $ */
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
@@ -62,17 +62,30 @@
#define fmax (*(double*)fmaxx)
#endif /* national */
-static const double
- zero = 0,
- one = 1,
- negone = -1,
- half = 1.0/2.0,
- small = 1E-10, /* 1+small**2 == 1; better values for small:
- * small = 1.5E-9 for VAX D
- * = 1.2E-8 for IEEE Double
- * = 2.8E-10 for IEEE Extended
- */
- big = 1E20; /* big := 1/(small**2) */
+#ifdef _LIBM_DECLARE
+const double
+ __zero = 0,
+ __one = 1,
+ __negone = -1,
+ __half = 1.0/2.0,
+#ifdef __vax__
+ __small = 1E-9, /* 1+small**2 == 1; better values for small:
+ * small = 1.5E-9 for VAX D
+ * = 1.2E-8 for IEEE Double
+ * = 2.8E-10 for IEEE Extended
+ */
+ __big = 1E18; /* big := 1/(small**2) */
+#else
+ __small = 1E-10, /* 1+small**2 == 1; better values for small:
+ * small = 1.5E-9 for VAX D
+ * = 1.2E-8 for IEEE Double
+ * = 2.8E-10 for IEEE Extended
+ */
+ __big = 1E20; /* big := 1/(small**2) */
+#endif
+#else
+extern const double __zero, __one, __negone, __half, __small, __big;
+#endif
/* sin__S(x*x) ... re-implemented as a macro
* DOUBLE PRECISION (VAX D format 56 bits, IEEE DOUBLE 53 BITS)
Home |
Main Index |
Thread Index |
Old Index