diff options
| author | Bruce Evans <bde@FreeBSD.org> | 2005-12-03 07:38:35 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 2005-12-03 07:38:35 +0000 |
| commit | 3fc5a433e95a01aad0785ed32af6fb2fc2436998 (patch) | |
| tree | 1009ca5e1b2fffe19f88b347297c125a58f00e30 /lib/msun | |
| parent | 7441377544253f2735d8aff17e43e2cd64826b41 (diff) | |
Notes
Diffstat (limited to 'lib/msun')
| -rw-r--r-- | lib/msun/src/s_rint.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/msun/src/s_rint.c b/lib/msun/src/s_rint.c index 2d9b672be07f..0a7bfc47a432 100644 --- a/lib/msun/src/s_rint.c +++ b/lib/msun/src/s_rint.c @@ -27,13 +27,7 @@ static char rcsid[] = "$FreeBSD$"; #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. - */ -static const long double +static const double TWO52[2]={ 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ @@ -88,6 +82,6 @@ rint(double x) if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20)); } INSERT_WORDS(x,i0,i1); - w = TWO52[sx]+x; + *(volatile double *)&w = TWO52[sx]+x; /* clip any extra precision */ return w-TWO52[sx]; } |
