summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-16 07:09:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-16 07:09:24 +0000
commit8ccd05c958fcf75d0e547d3c7786e4f27c737051 (patch)
tree30e5f9d087d6d65ada24ee18e8272dfc57dd56e2 /numeric.c
parentfd47fed2699a53cdeb26d204a6fb6a4b75db42ac (diff)
Revert "* numeric.c (ruby_float_step): Avoid error on i386 and amd64."
This reverts commit r33285 because of the message of r33284. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index 1701d1005e..18f5e1cd1a 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1683,7 +1683,6 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl)
double unit = NUM2DBL(step);
double n = (end - beg)/unit;
double err = (fabs(beg) + fabs(end) + fabs(end-beg)) / fabs(unit) * epsilon;
- double im = 0.0;
long i;
if (isinf(unit)) {
@@ -1692,8 +1691,7 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl)
else {
if (err>0.5) err=0.5;
n = floor(n + err);
- im = ((long)n)*unit+beg;
- if (!excl || im < end) n++;
+ if (!excl || ((long)n)*unit+beg < end) n++;
for (i=0; i<n; i++) {
rb_yield(DBL2NUM(i*unit+beg));
}