https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17097754782011-08-25T22:49:48ZRuby Issue Tracking SystemRuby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204122011-08-25T22:49:48Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Totally seems fine.</p>
<ul>
<li>A magic number 17 is DBL_DIG+2?</li>
<li>frexp call doesn't feel matching with the rest of the file.</li>
</ul> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204172011-08-26T05:29:09ZAnonymous
<ul></ul><p>Hi,</p>
<p>The 17 is the maximum number of digits needed to represent uniquely<br>
the double (see <a href="/issues/3273">[ruby-core:30145]</a> and <a href="https://blade.ruby-lang.org/ruby-core/30163">[ruby-core:30163]</a>).</p>
<p>On Thu, Aug 25, 2011 at 9:49 AM, Nobuyoshi Nakada <a href="mailto:nobu@ruby-lang.org" class="email">nobu@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Float#round fails on corner cases (Closed)" href="https://redmine.ruby-lang.org/issues/5227">#5227</a> has been updated by Nobuyoshi Nakada.</p>
<p>A magic number 17 is DBL_DIG+2?<br>
T</p>
</blockquote> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204182011-08-26T10:46:00Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>r33061 tried to fix this but the result isn't changed.</p>
<p>Additional to say:</p>
<ul>
<li>add test for this to test/ruby/test_float.rb</li>
<li>write Ticket number in ChangeLog and commit message<br>
(this is current limitation of Redmine-commit association)</li>
</ul> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204262011-08-27T04:53:08ZAnonymous
<ul></ul><p>Hi</p>
<p>On Thu, Aug 25, 2011 at 9:46 PM, Yui NARUSE <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<p>r33061 tried to fix this but the result isn't changed.</p>
</blockquote>
<p>Sorry, I do not understand. r33061 fixes Integer#round, which had a<br>
completely different issue from Float#round (see redmine <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Integer#round fails on some big negative numbers (Closed)" href="https://redmine.ruby-lang.org/issues/5228">#5228</a>)</p>
<blockquote>
<p>Additional to say:</p>
<ul>
<li>add test for this to test/ruby/test_float.rb</li>
</ul>
</blockquote>
<p>I already committed tests in RubySpec, which I believe is where they<br>
are the most useful.</p>
<blockquote>
<ul>
<li>write Ticket number in ChangeLog and commit message<br>
 (this is current limitation of Redmine-commit association)</li>
</ul>
</blockquote>
<p>Ah, thanks, I didn't realize this had changed. I updated the<br>
contributer guidelines wiki page (<br>
<a href="http://redmine.ruby-lang.org/projects/ruby/wiki/CommitterHowto" class="external">http://redmine.ruby-lang.org/projects/ruby/wiki/CommitterHowto</a> ) but I<br>
don't have write access to another that should be updated accordingly:<br>
<a href="http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem" class="external">http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem</a></p>
<p>Can someone either give me access or update it?</p>
<p>Thanks</p>
<blockquote>
<hr>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Float#round fails on corner cases (Closed)" href="https://redmine.ruby-lang.org/issues/5227">#5227</a>: Float#round fails on corner cases<br>
<a href="http://redmine.ruby-lang.org/issues/5227" class="external">http://redmine.ruby-lang.org/issues/5227</a></p>
<p>Author: Marc-Andre Lafortune<br>
Status: Assigned<br>
Priority: Normal<br>
Assignee: Marc-Andre Lafortune<br>
Category: core<br>
Target version: 1.9.3<br>
ruby -v: r32601</p>
<p>Float#round fails on some corner cases:</p>
<p>Â 42.0.round(300) #</p>
</blockquote> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204402011-08-27T17:23:09Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>ruby -v</strong> changed from <i>r32601</i> to <i>-</i></li></ul><p>Hi,</p>
<p>At Sat, 27 Aug 2011 04:40:16 +0900,<br>
Marc-Andre Lafortune wrote in <a href="/issues/5227">[ruby-core:39126]</a>:</p>
<blockquote>
<blockquote>
<p>Additional to say:</p>
<ul>
<li>add test for this to test/ruby/test_float.rb</li>
</ul>
</blockquote>
<p>I already committed tests in RubySpec, which I believe is where they<br>
are the most useful.</p>
</blockquote>
<p>No. In fact, your patch breaks test/ruby/test_float.rb.</p>
<ol>
<li>Failure:<br>
test_round_with_precision(TestFloat) [test/ruby/test_float.rb:326]:<br>
<1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000><br>
expected but was<br>
<0>.</li>
</ol>
<p>--<br>
Nobu Nakada</p> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204412011-08-27T17:53:10Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>(2011/08/27 4:40), Marc-Andre Lafortune wrote:</p>
<blockquote>
<p>On Thu, Aug 25, 2011 at 9:46 PM, Yui NARUSE <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<p>r33061 tried to fix this but the result isn't changed.</p>
</blockquote>
<p>Sorry, I do not understand. r33061 fixes Integer#round, which had a<br>
completely different issue from Float#round (see redmine <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Integer#round fails on some big negative numbers (Closed)" href="https://redmine.ruby-lang.org/issues/5228">#5228</a>)</p>
</blockquote>
<p>./ruby -ve'p 42.0.round(308)'<br>
ruby 1.9.4dev (2011-08-26 trunk 33073) [x86_64-freebsd8.2]<br>
Infinity</p>
<blockquote>
<blockquote>
<p>Additional to say:</p>
<ul>
<li>add test for this to test/ruby/test_float.rb</li>
</ul>
</blockquote>
<p>I already committed tests in RubySpec, which I believe is where they<br>
are the most useful.</p>
</blockquote>
<p>Adding tests to RubySpec is not enough.<br>
You should also add tests to CRuby's test-all.</p>
<p>Moreover it fails on my environment:</p>
<ol start="2">
<li>
</ol>
<p>Float#round works for corner cases FAILED<br>
Expected Infinity<br>
to equal 42.0</p>
<p>/usr/home/chkbuild/build/ruby-trunk/20110827T070101Z/rubyspec/core/float/round_spec.rb:30:in <code>block (4 levels) in <top (required)>' /usr/home/chkbuild/build/ruby-trunk/20110827T070101Z/rubyspec/core/float/round_spec.rb:3:in </code><top (required)>'<br>
<a href="http://59.106.172.211/~chkbuild/ruby-trunk/log/20110827T070101Z.log.html.gz" class="external">http://59.106.172.211/~chkbuild/ruby-trunk/log/20110827T070101Z.log.html.gz</a><br>
<a href="http://59.106.172.211/~chkbuild/ruby-trunk/recent.html" class="external">http://59.106.172.211/~chkbuild/ruby-trunk/recent.html</a></p>
<blockquote>
<blockquote>
<ul>
<li>write Ticket number in ChangeLog and commit message<br>
(this is current limitation of Redmine-commit association)</li>
</ul>
</blockquote>
<p>Ah, thanks, I didn't realize this had changed. I updated the<br>
contributer guidelines wiki page (<br>
<a href="http://redmine.ruby-lang.org/projects/ruby/wiki/CommitterHowto" class="external">http://redmine.ruby-lang.org/projects/ruby/wiki/CommitterHowto</a> ) but I<br>
don't have write access to another that should be updated accordingly:<br>
<a href="http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem" class="external">http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem</a></p>
<p>Can someone either give me access or update it?</p>
</blockquote>
<p>Added.</p>
<p>--<br>
NARUSE, Yui <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a></p> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204622011-08-29T04:53:12ZAnonymous
<ul></ul><p>Hi,</p>
<p>On Sat, Aug 27, 2011 at 4:20 AM, Nobuyoshi Nakada <a href="mailto:nobu@ruby-lang.org" class="email">nobu@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>In fact, your patch breaks test/ruby/test_float.rb.</p>
</blockquote>
<p>Oh, I didn't realize that <code>make test-all</code> does not recompile modified<br>
.c files. Is there a good reason for that?</p>
<p>In any case, I write specs in RubySpec, but ruby's tests must still be<br>
run too, of course!</p>
<p>Indeed, I made a mistake in the inequalities for the 3 or 4<br>
approximation (should test for binexp > 0, not < 0). Here's the<br>
differential patch:</p>
<p>diff --git a/numeric.c b/numeric.c<br>
index 4c48355..ac38bb1 100644<br>
--- a/numeric.c<br>
+++ b/numeric.c<br>
@@ -1517,10 +1517,10 @@ flo_round(int argc, VALUE *argv, VALUE num)<br>
So if ndigits + binexp/(3 or 4) >= 17, the result is number<br>
If ndigits + binexp/(4 or 3) < 0 the result is 0<br>
*/</p>
<ul>
<li>if ((long)ndigits * (4 - (binexp < 0)) + binexp < 0) {</li>
</ul>
<ul>
<li>if ((long)ndigits * (4 - (binexp > 0)) + binexp < 0) {<br>
number = 0;<br>
}</li>
</ul>
<ul>
<li>else if ((long)(ndigits - 17) * (3 + (binexp < 0)) + binexp < 0) {</li>
</ul>
<ul>
<li>else if ((long)(ndigits - 17) * (3 + (binexp > 0)) + binexp < 0) {<br>
f = pow(10, abs(ndigits));<br>
if (ndigits < 0) {<br>
double absnum = fabs(number);</li>
</ul>
<p>The complete patch becomes:</p>
<p>diff --git a/numeric.c b/numeric.c<br>
index ab890c6..2277296 100644<br>
--- a/numeric.c<br>
+++ b/numeric.c<br>
@@ -1491,18 +1491,37 @@ flo_round(int argc, VALUE *argv, VALUE num)<br>
VALUE nd;<br>
double number, f;<br>
int ndigits = 0;</p>
<ul>
<li>
<p>int binexp;<br>
long val;</p>
<p>if (argc > 0 && rb_scan_args(argc, argv, "01", &nd) == 1) {<br>
ndigits = NUM2INT(nd);<br>
}<br>
number = RFLOAT_VALUE(num);</p>
</li>
</ul>
<ul>
<li>f = pow(10, abs(ndigits));</li>
<li>
<li>if (isinf(f)) {</li>
<li>
<pre><code> if (ndigits < 0) number = 0;
</code></pre>
</li>
<li>}</li>
<li>else {</li>
</ul>
<ul>
<li>frexp (number , &binexp);</li>
<li>
</ul>
<p>+/* Let <code>exp</code> be such that <code>number</code> is written as:"0.#{digits}e#{exp}",</p>
<ul>
<li>i.e. such that 10 ** (exp - 1) <= |number| < 10 ** exp</li>
<li>Recall that up to 17 digits can be needed to represent a double,</li>
<li>so if ndigits + exp >= 17, the intermediate value (number * 10 ** ndigits)</li>
<li>will be an integer and thus the result is the original number.</li>
<li>If ndigits + exp <= 0, the result is 0 or "1e#{exp}", so</li>
<li>if ndigits + exp < 0, the result is 0.</li>
<li>We have:</li>
<li>
<pre><code> 2 ** (binexp-1) <= |number| < 2 ** binexp
</code></pre>
</li>
<li>
<pre><code> 10 ** ((binexp-1)/log_2(10)) <= |number| < 10 ** (binexp/log_2(10))
</code></pre>
</li>
<li>
<pre><code> If binexp >= 0, and since log_2(10) = 3.322259:
</code></pre>
</li>
<li>
<pre><code> 10 ** (binexp/4 - 1) < |number| < 10 ** (binexp/3)
</code></pre>
</li>
<li>
<pre><code> binexp/4 <= exp <= binexp/3
</code></pre>
</li>
<li>
<pre><code> If binexp <= 0, swap the /4 and the /3
</code></pre>
</li>
<li>
<pre><code> So if ndigits + binexp/(4 or 3) >= 17, the result is number
</code></pre>
</li>
<li>
<pre><code> If ndigits + binexp/(3 or 4) < 0 the result is 0
</code></pre>
</li>
</ul>
<p>+*/</p>
<ul>
<li>if ((long)ndigits * (4 - (binexp > 0)) + binexp < 0) {</li>
<li>
<pre><code> number = 0;
</code></pre>
</li>
<li>}</li>
<li>else if ((long)(ndigits - 17) * (3 + (binexp > 0)) + binexp < 0) {</li>
<li>
<pre><code> f = pow(10, abs(ndigits));
if (ndigits < 0) {
double absnum = fabs(number);
if (absnum < f) return INT2FIX(0);
</code></pre>
</li>
</ul> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204632011-08-29T04:53:12ZAnonymous
<ul></ul><p>Hi,</p>
<p>On Sat, Aug 27, 2011 at 4:32 AM, NARUSE, Yui <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<p>(2011/08/27 4:40), Marc-Andre Lafortune wrote:</p>
<blockquote>
<p>On Thu, Aug 25, 2011 at 9:46 PM, Yui NARUSE <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<p>r33061 tried to fix this but the result isn't changed.</p>
</blockquote>
<p>Sorry, I do not understand. r33061 fixes Integer#round, which had a<br>
completely different issue from Float#round (see redmine <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Integer#round fails on some big negative numbers (Closed)" href="https://redmine.ruby-lang.org/issues/5228">#5228</a>)</p>
</blockquote>
<p>./ruby -ve'p 42.0.round(308)'<br>
ruby 1.9.4dev (2011-08-26 trunk 33073) [x86_64-freebsd8.2]<br>
Infinity</p>
</blockquote>
<p>How is this in any way related to r33061?</p>
<blockquote>
<p>Adding tests to RubySpec is not enough.<br>
You should also add tests to CRuby's test-all.</p>
</blockquote>
<p>I respectfully disagree.</p>
<blockquote>
<p>Moreover it fails on my environment:</p>
</blockquote>
<p>Could you please double check this, or else give me information so I<br>
can try to reproduce this, as I don't see how this could be the case.<br>
Maybe you got bitten by the fact that <code>make test-rubyspec</code> does not<br>
recompile modified sources, like I was with <code>make test-all</code> (see my<br>
previous message to Nobu)?</p>
<blockquote>
<blockquote>
<p>Can someone either give me access or update it?</p>
</blockquote>
<p>Added.</p>
</blockquote>
<p>Thanks, but somehow I still can't edit the page<br>
<a href="http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem" class="external">http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem</a></p> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=204652011-08-29T09:59:06Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>2011/8/29 Marc-Andre Lafortune <a href="mailto:ruby-core-mailing-list@marc-andre.ca" class="email">ruby-core-mailing-list@marc-andre.ca</a>:</p>
<blockquote>
<p>On Sat, Aug 27, 2011 at 4:32 AM, NARUSE, Yui <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<p>(2011/08/27 4:40), Marc-Andre Lafortune wrote:</p>
<blockquote>
<p>On Thu, Aug 25, 2011 at 9:46 PM, Yui NARUSE <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<p>r33061 tried to fix this but the result isn't changed.</p>
</blockquote>
<p>Sorry, I do not understand. r33061 fixes Integer#round, which had a<br>
completely different issue from Float#round (see redmine <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Integer#round fails on some big negative numbers (Closed)" href="https://redmine.ruby-lang.org/issues/5228">#5228</a>)</p>
</blockquote>
<p>./ruby -ve'p 42.0.round(308)'<br>
ruby 1.9.4dev (2011-08-26 trunk 33073) [x86_64-freebsd8.2]<br>
Infinity</p>
</blockquote>
<p>How is this in any way related to r33061?</p>
</blockquote>
<p>It happens after r33061.<br>
You can know after r33066, RubySpec F is increased.<br>
20110825T020101Z ruby 1.9.4dev (2011-08-25 trunk 33066)<br>
[x86_64-freebsd8.2] (fbsd) 1851W rubyspec:3F0E<br>
(diff:src,btest,make,install-nodoc,test-all,rubyspec)<br>
<a href="http://59.106.172.211/~chkbuild/ruby-trunk/summary.html" class="external">http://59.106.172.211/~chkbuild/ruby-trunk/summary.html</a></p>
<p>It suspects a commit between r33047 and r33066 breaks it.<br>
...but in this case, it is because you add a test to RubySpec, sorry.</p>
<blockquote>
<blockquote>
<p>Adding tests to RubySpec is not enough.<br>
You should also add tests to CRuby's test-all.</p>
</blockquote>
<p>I respectfully disagree.</p>
</blockquote>
<p>RubySpec is not CRuby's implementation test, it is a different thing.<br>
You must add a test to test-all when you change CRuby's behavior.</p>
<blockquote>
<blockquote>
<blockquote>
<p>Can someone either give me access or update it?</p>
</blockquote>
<p>Added.</p>
</blockquote>
<p>Thanks, but somehow I still can't edit the page<br>
<a href="http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem" class="external">http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem</a></p>
</blockquote>
<p>I added you a edit bit; did you unlocked the page?<br>
(I don't know if you unlock it then can edit but...)</p>
<p>--<br>
NARUSE, Yui  <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a></p> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=205032011-08-31T09:53:06ZAnonymous
<ul></ul><p>Hi,</p>
<p>On Sun, Aug 28, 2011 at 8:53 PM, NARUSE, Yui <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<blockquote>
<blockquote>
<p>Adding tests to RubySpec is not enough.<br>
You should also add tests to CRuby's test-all.</p>
</blockquote>
<p>I respectfully disagree.</p>
</blockquote>
<p>RubySpec is not CRuby's implementation test, it is a different thing.<br>
You must add a test to test-all when you change CRuby's behavior.</p>
</blockquote>
<p>RubySpec is part of CRuby's implementation test.<br>
Do you have arguments against having tests in RubySpec instead of test/ruby?</p>
<blockquote>
<blockquote>
<p>Thanks, but somehow I still can't edit the page<br>
<a href="http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem" class="external">http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem</a></p>
</blockquote>
<p>I added you a edit bit; did you unlocked the page?<br>
(I don't know if you unlock it then can edit but...)</p>
</blockquote>
<p>Sorry, I don't know what "unlocking" a wiki page is. The only<br>
functionality that I see for that particular page is 'history'. Maybe<br>
you can modify it yourself?</p> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=205042011-08-31T10:23:06Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>2011/8/31 Marc-Andre Lafortune <a href="mailto:ruby-core-mailing-list@marc-andre.ca" class="email">ruby-core-mailing-list@marc-andre.ca</a>:</p>
<blockquote>
<p>Hi,</p>
<p>On Sun, Aug 28, 2011 at 8:53 PM, NARUSE, Yui <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<blockquote>
<blockquote>
<p>Adding tests to RubySpec is not enough.<br>
You should also add tests to CRuby's test-all.</p>
</blockquote>
<p>I respectfully disagree.</p>
</blockquote>
<p>RubySpec is not CRuby's implementation test, it is a different thing.<br>
You must add a test to test-all when you change CRuby's behavior.</p>
</blockquote>
<p>RubySpec is part of CRuby's implementation test.<br>
Do you have arguments against having tests in RubySpec instead of test/ruby?</p>
</blockquote>
<p>Because I don't think RubySpec is part of CRuby's implementation test.<br>
I believe other CRuby people also think so.<br>
So on current situation you must add a test to test-all.<br>
(If you can persuade other committers, I'll follow you)</p>
<blockquote>
<blockquote>
<blockquote>
<p>Thanks, but somehow I still can't edit the page<br>
<a href="http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem" class="external">http://redmine.ruby-lang.org/projects/redmine/wiki/VersionControlSystem</a></p>
</blockquote>
<p>I added you a edit bit; did you unlocked the page?<br>
(I don't know if you unlock it then can edit but...)</p>
</blockquote>
<p>Sorry, I don't know what "unlocking" a wiki page is. The only<br>
functionality that I see for that particular page is 'history'. Maybe<br>
you can modify it yourself?</p>
</blockquote>
<p>Commented out ML number cooperation.</p>
<p>--<br>
NARUSE, Yui  <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a></p> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=205072011-08-31T13:13:02Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r33140.<br>
Marc-Andre, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>numeric.c (flo_round): Avoid overflow by optimizing for trivial cases<br>
[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Float#round fails on corner cases (Closed)" href="https://redmine.ruby-lang.org/issues/5227">#5227</a>]</li>
</ul> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=205082011-08-31T14:29:06Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>"So what's the test going to achieve? What's that test for?" said my<br>
teacher another day. A test has a perspective. No test can be suitable<br>
for everything.</p>
<p>It seems to me RubySpec is meant to be a written behavioral description.<br>
Which is not a bad thing of course, but I think Yui needs a regression<br>
test instead. It does test CRuby's implementation but doesn't help him.</p> Ruby master - Bug #5227: Float#round fails on corner caseshttps://redmine.ruby-lang.org/issues/5227?journal_id=205742011-09-05T03:53:07ZAnonymous
<ul></ul><p>Hi,</p>
<p>On Tue, Aug 30, 2011 at 9:19 PM, NARUSE, Yui <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<blockquote>
<p>RubySpec is part of CRuby's implementation test.<br>
Do you have arguments against having tests in RubySpec instead of test/ruby?</p>
</blockquote>
<p>Because I don't think RubySpec is part of CRuby's implementation test.<br>
I believe other CRuby people also think so.<br>
So on current situation you must add a test to test-all.<br>
(If you can persuade other committers, I'll follow you)</p>
</blockquote>
<p>Although I'm a newbie and not great at persuading people of anything,<br>
I'll start a new thread about this.</p>
<blockquote>
<p>Commented out ML number cooperation.</p>
</blockquote>
<p>Thanks!</p>