summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-22 02:59:09 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-22 02:59:09 (GMT)
commitf544ca4e4e817dd722d96f09e15b0170a5b392cd (patch)
treeb3f8f40cd8cd98ad73951e6a2417a92a91644784 /util.c
parente9679c9ad49c1969a9aded71e194e249aa8b8547 (diff)
* util.c (ruby_hdtoa): revert r29729.
If you want ruby to behave as before on x86, specify to use SSE like -msse2 -mfpmath=sse for gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/util.c b/util.c
index 733045d..fb72931 100644
--- a/util.c
+++ b/util.c
@@ -3878,13 +3878,10 @@ ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign,
/* Round to the desired number of digits. */
if (SIGFIGS > ndigits && ndigits > 0) {
float redux = 1.0f;
- volatile double d;
int offset = 4 * ndigits + DBL_MAX_EXP - 4 - DBL_MANT_DIG;
dexp_set(u, offset);
- d = u.d;
- d += redux;
- d -= redux;
- u.d = d;
+ u.d += redux;
+ u.d -= redux;
*decpt += dexp_get(u) - offset;
}