ruby-changes:21237
From: naruse <ko1@a...>
Date: Fri, 16 Sep 2011 16:09:37 +0900 (JST)
Subject: [ruby-changes:21237] naruse:r33286 (trunk): Revert "* numeric.c (ruby_float_step): Avoid error on i386 and amd64."
naruse 2011-09-16 16:09:24 +0900 (Fri, 16 Sep 2011) New Revision: 33286 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33286 Log: Revert "* numeric.c (ruby_float_step): Avoid error on i386 and amd64." This reverts commit r33285 because of the message of r33284. Modified files: trunk/ChangeLog trunk/numeric.c Index: ChangeLog =================================================================== --- ChangeLog (revision 33285) +++ ChangeLog (revision 33286) @@ -1,8 +1,3 @@ -Fri Sep 16 02:05:44 2011 Marc-Andre Lafortune <ruby-core@m...> - - * 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@r...> * gc.c (mark_entry, mark_key, mark_keyvalue): adjust callback Index: numeric.c =================================================================== --- numeric.c (revision 33285) +++ numeric.c (revision 33286) @@ -1683,7 +1683,6 @@ 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 @@ 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)); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/