aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
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 733045daa4..fb72931ed5 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;
}