https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-03-07T22:37:53ZRuby Issue Tracking SystemRuby master - Bug #6120: Float and BigDecimal bug in remainder in corner caseshttps://bugs.ruby-lang.org/issues/6120?journal_id=243542012-03-07T22:37:53Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>Ruby's math should portably follow SuS. <a href="https://blade.ruby-lang.org/ruby-core/28206">[ruby-core:28206]</a><br>
You can fix it for Float/Math if it is obviously wrong and the right implementation is clear.</p>
<p>BigDecimal is little another world and it is up to mrkn.</p> Ruby master - Bug #6120: Float and BigDecimal bug in remainder in corner caseshttps://bugs.ruby-lang.org/issues/6120?journal_id=248412012-03-18T18:46:11Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Ruby master - Bug #6120: Float and BigDecimal bug in remainder in corner caseshttps://bugs.ruby-lang.org/issues/6120?journal_id=365112013-02-18T21:24:33Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>2.6</i></li></ul><p>Should it be assigned to mrkn?</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Bug #6120: Float and BigDecimal bug in remainder in corner caseshttps://bugs.ruby-lang.org/issues/6120?journal_id=365622013-02-19T01:44:06Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul></ul><p>Didn't get around fixing it for 2.0.0. Will fix and then assign to mrkn for BigDecimal.</p> Ruby master - Bug #6120: Float and BigDecimal bug in remainder in corner caseshttps://bugs.ruby-lang.org/issues/6120?journal_id=687542017-12-25T18:15:04Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.6</i></del>)</li></ul> Ruby master - Bug #6120: Float and BigDecimal bug in remainder in corner caseshttps://bugs.ruby-lang.org/issues/6120?journal_id=908702021-03-10T22:41:42Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>I've submitted a pull request to fix this issue for Integer/Float: <a href="https://github.com/ruby/ruby/pull/4257" class="external">https://github.com/ruby/ruby/pull/4257</a></p>
<p>I've submitted an issue to the bigdecimal repository to fix the issue in BigDecimal: <a href="https://github.com/ruby/bigdecimal/issues/187" class="external">https://github.com/ruby/bigdecimal/issues/187</a></p> Ruby master - Bug #6120: Float and BigDecimal bug in remainder in corner caseshttps://bugs.ruby-lang.org/issues/6120?journal_id=908912021-03-12T15:36:03Zjeremyevans (Jeremy Evans)code@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="Fix integer/float remainder with infinity argument of opposite sign Previously, the result was i..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/aaab3b1de943c3317e115d623ffc7908b4c96578">git|aaab3b1de943c3317e115d623ffc7908b4c96578</a>.</p>
<hr>
<p>Fix integer/float remainder with infinity argument of opposite sign</p>
<p>Previously, the result was incorrect:</p>
<p>4.remainder(-Float::INFINITY)<br>
Before: => NaN<br>
After: => 4</p>
<p>4.2.remainder(-Float::INFINITY)<br>
Before: => NaN<br>
After: => 4.2</p>
<p>Fixes [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Float and BigDecimal bug in remainder in corner cases (Closed)" href="https://bugs.ruby-lang.org/issues/6120">#6120</a>]</p>