summaryrefslogtreecommitdiff
path: root/lib/msun
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1996-08-28 16:34:36 +0000
committerBruce Evans <bde@FreeBSD.org>1996-08-28 16:34:36 +0000
commit2aa9f7ca2c32749130c8bfdcd38b2a2a95076867 (patch)
tree1263974842c58b03868a54b6d0c8d0754e88b3d5 /lib/msun
parent38005cc5104c8f9466061160c9c77621e2939a7d (diff)
Notes
Diffstat (limited to 'lib/msun')
-rw-r--r--lib/msun/src/s_rint.c13
-rw-r--r--lib/msun/src/s_rintf.c12
2 files changed, 19 insertions, 6 deletions
diff --git a/lib/msun/src/s_rint.c b/lib/msun/src/s_rint.c
index 3476eeff4cad..81a13965bc28 100644
--- a/lib/msun/src/s_rint.c
+++ b/lib/msun/src/s_rint.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: s_rint.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $";
+static char rcsid[] = "$Id: s_rint.c,v 1.2 1995/05/30 05:50:18 rgrimes Exp $";
#endif
/*
@@ -27,10 +27,17 @@ static char rcsid[] = "$Id: s_rint.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $";
#include "math.h"
#include "math_private.h"
+/*
+ * TWO23 is long double instead of double to avoid a bug in gcc. Without
+ * this, gcc thinks that TWO23[sx]+x and w-TWO23[sx] already have double
+ * precision and doesn't clip them to double precision when they are
+ * assigned and returned. Use long double even in the !__STDC__ case in
+ * case this is compiled with gcc -traditional.
+ */
#ifdef __STDC__
-static const double
+static const long double
#else
-static double
+static long double
#endif
TWO52[2]={
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
diff --git a/lib/msun/src/s_rintf.c b/lib/msun/src/s_rintf.c
index 4e77aab2391d..90a85a310b48 100644
--- a/lib/msun/src/s_rintf.c
+++ b/lib/msun/src/s_rintf.c
@@ -14,16 +14,22 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: s_rintf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $";
+static char rcsid[] = "$Id: s_rintf.c,v 1.2 1995/05/30 05:50:21 rgrimes Exp $";
#endif
#include "math.h"
#include "math_private.h"
+/*
+ * TWO23 is double instead of float to avoid a bug in gcc. Without
+ * this, gcc thinks that TWO23[sx]+x and w-TWO23[sx] already have float
+ * precision and doesn't clip them to float precision when they are
+ * assigned and returned.
+ */
#ifdef __STDC__
-static const float
+static const double
#else
-static float
+static double
#endif
TWO23[2]={
8.3886080000e+06, /* 0x4b000000 */