1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
naruse 2011-09-16 07:09:24 +00:00
parent fd47fed269
commit 8ccd05c958
2 changed files with 1 additions and 8 deletions

View file

@ -1,8 +1,3 @@
Fri Sep 16 02:05:44 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* numeric.c (ruby_float_step): Avoid error on i386 and amd64.
Patch by Vit Ondruch. Issue #4576.
Thu Sep 15 11:39:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (mark_entry, mark_key, mark_keyvalue): adjust callback

View file

@ -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));
}