https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112015-10-11T23:25:07ZRuby Issue Tracking SystemRuby master - Bug #11582: On Solaris, Rational#** returns -Infinity for Rational(0) when passed a negative Floathttps://bugs.ruby-lang.org/issues/11582?journal_id=544182015-10-11T23:25:07Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Does <code>0.0 ** -1</code> return <code>-Infinity</code> too?<br>
It isn't a problem?</p> Ruby master - Bug #11582: On Solaris, Rational#** returns -Infinity for Rational(0) when passed a negative Floathttps://bugs.ruby-lang.org/issues/11582?journal_id=544362015-10-13T03:12:45Zngoto (Naohisa Goto)ngotogenome@gmail.com
<ul></ul><blockquote>
<p>Does 0.0 ** -1 return -Infinity too?</p>
</blockquote>
<p>Yes, with default compiler option.<br>
On Solaris, the 0.0 ** -1 could return 3 different values depending on compile-time options: 0, -Infinity, +Infinity.</p>
<p>See below for list of corner-case variations of numerical calculations.<br>
<a href="http://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac610479.html" class="external">http://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac610479.html</a></p>
<blockquote>
<p>It isn't a problem?</p>
</blockquote>
<p>I don't know.</p> Ruby master - Bug #11582: On Solaris, Rational#** returns -Infinity for Rational(0) when passed a negative Floathttps://bugs.ruby-lang.org/issues/11582?journal_id=1030272023-05-10T01:33:30Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Third Party's Issue</i></li></ul><p>This is an inconsistency in the default behavior of the Solaris pow function compared to other platforms. You could file this as a bug in the Illumios bug tracker (or raise an issue with Oracle Solaris support) if you would like them to change the behavior: <a href="https://www.illumos.org/projects/illumos-gate/issues" class="external">https://www.illumos.org/projects/illumos-gate/issues</a></p> Ruby master - Bug #11582: On Solaris, Rational#** returns -Infinity for Rational(0) when passed a negative Floathttps://bugs.ruby-lang.org/issues/11582?journal_id=1030792023-05-16T03:20:09Zngoto (Naohisa Goto)ngotogenome@gmail.com
<ul><li><strong>Status</strong> changed from <i>Third Party's Issue</i> to <i>Closed</i></li></ul><p>This issue is solved by [Misc <a class="issue tracker-5 status-5 priority-4 priority-default closed" title="Misc: Require C99 (Closed)" href="https://bugs.ruby-lang.org/issues/15347">#15347</a>].</p>
<p>In the C99 spec, The behavior of pow(3) in corner cases are clearly defined.<br>
Since Ruby 2.7, C99 is required to compile CRuby source code, and thus Ruby's pow method conforms to the C99 standard.</p>