https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112010-06-11T22:37:47ZRuby Issue Tracking SystemRuby master - Feature #3429: Integer#**(large) warns "in a**b, b may be too big" and return Infinityhttps://bugs.ruby-lang.org/issues/3429?journal_id=116232010-06-11T22:37:47ZEregon (Benoit Daloze)
<ul></ul><p>=begin<br>
"And Integer<strong>Integer should always return an Integer (Infinity is a Float)"<br>
=> I meant Integer</strong>(positive Integer) of course<br>
=end</p> Ruby master - Feature #3429: Integer#**(large) warns "in a**b, b may be too big" and return Infinityhttps://bugs.ruby-lang.org/issues/3429?journal_id=116272010-06-11T22:58:41Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Target version</strong> changed from <i>1.9.2</i> to <i>2.0.0</i></li></ul><p>=begin<br>
Hi,</p>
<p>I agree that it is not good behavior, but it is definitely intended<br>
and traditional behavior. Not a bug.</p>
<p>1.9.2 should not be changed. Let's discuss towards 1.9.3.<br>
I move to 1.9.x feature request.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p> Ruby master - Feature #3429: Integer#**(large) warns "in a**b, b may be too big" and return Infinityhttps://bugs.ruby-lang.org/issues/3429?journal_id=116302010-06-11T23:45:46ZEregon (Benoit Daloze)
<ul></ul><p>=begin<br>
On 11 June 2010 15:58, Yusuke Endoh <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> wrote:<br>
| I agree that it is not good behavior, but it is definitely intended<br>
| and traditional behavior. Not a bug.</p>
<p>For a mathematician, and even if he takes care of computing<br>
limitations, he would think it is a bug I believe ;)<br>
Python, by example, does not complain (and it works) for this.<br>
But yes, this behavior is common in many languages I suppose, but as<br>
we have Bignum built-in, it seems logical Integer*(Integer>0) returns<br>
an Integer, whatever the size is, at least until it becomes too bad<br>
for the memory.</p>
<p>| 1.9.2 should not be changed. Let's discuss towards 1.9.3.<br>
| I move to 1.9.x feature request.</p>
<p>Sure, I was hesitating for the target. As I think it is important<br>
because it is basic maths, I did choose 1.9.2.</p>
<p>| Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>
<p>B.D</p>
<p>=end</p> Ruby master - Feature #3429: Integer#**(large) warns "in a**b, b may be too big" and return Infinityhttps://bugs.ruby-lang.org/issues/3429?journal_id=247222012-03-18T16:50:22Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/24722/diff?detail_id=18020">diff</a>)</li><li><strong>Assignee</strong> set to <i>mrkn (Kenta Murata)</i></li></ul><p>mrkn, please handle this.</p> Ruby master - Feature #3429: Integer#**(large) warns "in a**b, b may be too big" and return Infinityhttps://bugs.ruby-lang.org/issues/3429?journal_id=247242012-03-18T17:17:52Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</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 r35081.<br>
Benoit, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>bignum.c (rb_big_pow): estimate result bit size more precisely.<br>
<a href="/issues/3429">[ruby-core:30735]</a>[Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Integer#**(large) warns "in a**b, b may be too big" and return Infinity (Closed)" href="https://bugs.ruby-lang.org/issues/3429">#3429</a>]</li>
</ul>