Actions
Bug #768
closedMathn's Rational#power2 is broken on 1.8.6 and 1.8.7
Description
=begin
Mathn's Rational#power2 method is broken in multiple places.
- The loop has no variant, it can go into an infinite loop, unless the conditional is true from the start.
- 1.8.6 still has the neaed typo (Redmine #175)
- assignment to nearn on line 208
- Construction of a Rational with 2 non-existant variables: num and den (dem is used, but not den)
Some test cases that demonstrate the broken code:
(Rational.new!(1, 4).power2(Rational.new!(1, 2))) #(NameError for neaed)
(Rational.new!(3, 4).power2(Rational.new!(0, 3))) #Infinite loop
=end
Updated by jredville (Jim Deville) about 16 years ago
=begin
This is a dup of 769. Please close.
=end
Updated by matz (Yukihiro Matsumoto) almost 16 years ago
- Status changed from Open to Closed
=begin
=end
Actions
Like0
Like0Like0