Bug #141
closed
Rational#power2 loops when the argument is 0
Added by krsh (Gianluigi Spagnuolo) over 16 years ago.
Updated over 13 years ago.
Description
=begin
Rational#power2, when passed Rational, loop if the argument is 0.
For example:
Rational.new!(3, 4).power2(Rational.new!(0, 3))
=end
=begin
Gianluigi Spagnuolo wrote:
Rational#power2, when passed Rational, loop if the argument is 0.
For example:
Rational.new!(3, 4).power2(Rational.new!(0, 3))
That's because you're using unrecommended new! and undocumented power2,
both are not expected to be used.
Rational(3, 4) ** Rational(0, 3) should return immediately.
Index: lib/mathn.rb¶
--- lib/mathn.rb (revision 17088)
+++ lib/mathn.rb (working copy)
@@ -186,6 +186,7 @@
def power2(other)
if other.kind_of?(Rational)
=end
- Status changed from Open to Closed
- Assignee set to matz (Yukihiro Matsumoto)
Also available in: Atom
PDF
Like0
Like0Like0