https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112017-01-20T04:26:28ZRuby Issue Tracking SystemRuby master - Bug #13104: mathn.rb affects Rational literalshttps://bugs.ruby-lang.org/issues/13104?journal_id=626022017-01-20T04:26:28Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>We looked at this issue at yesterday's developer meeting.</p>
<p>The intension was not made clear, but we confirmed that mathn's global side-effects are the nature of that library. Maybe requiring it implies your willing to accept such surprising behaviour.</p> Ruby master - Bug #13104: mathn.rb affects Rational literalshttps://bugs.ruby-lang.org/issues/13104?journal_id=626082017-01-20T05:24:44Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Subject</strong> changed from <i>math.rb affects Rational literals</i> to <i>mathn.rb affects Rational literals</i></li></ul><p>Just "don't use math"?</p> Ruby master - Bug #13104: mathn.rb affects Rational literalshttps://bugs.ruby-lang.org/issues/13104?journal_id=631522017-02-23T20:19:37Zstomar (Marcus Stollsteimer)
<ul></ul><p>Seems to be triggered by <code>ext/mathn/rational/rational.c</code> and <code>ext/mathn/complex/complex.c</code>, which activate "canonicalization" in <code>rational.c</code> and <code>complex.c</code>.</p>
<pre><code>$ ruby -r mathn/rational -e 'p Rational(2/1)'
2
$ ruby -r mathn/complex -e 'p Complex("3+0i")'
3
</code></pre>
<p>I suppose the reasoning behind the behavior was that in mathematics generally the simplest representation of a number is used, and n/1 = n.</p>
<p>But what are the plans for <code>mathn</code> anyway? -- It seems to be deprecated since 2.2 (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: It might be better to make Mathn class deprecated (Closed)" href="https://bugs.ruby-lang.org/issues/10169">#10169</a>).</p> Ruby master - Bug #13104: mathn.rb affects Rational literalshttps://bugs.ruby-lang.org/issues/13104?journal_id=681182017-12-01T16:30:13Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.5</i></del>)</li></ul><p>mathn is out of scope from release engineering.</p> Ruby master - Bug #13104: mathn.rb affects Rational literalshttps://bugs.ruby-lang.org/issues/13104?journal_id=800512019-07-25T23:46:59Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>mathn was removed in Ruby 2.5.</p>