Project

General

Profile

Bug #768

Mathn's Rational#power2 is broken on 1.8.6 and 1.8.7

Added by jredville (Jim Deville) over 10 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
[ruby-core:20009]

Description

=begin
Mathn's Rational#power2 method is broken in multiple places.

  1. The loop has no variant, it can go into an infinite loop, unless the conditional is true from the start.
  2. 1.8.6 still has the neaed typo (Redmine #175)
  3. assignment to nearn on line 208
  4. 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


Related issues

Is duplicate of Ruby 1.8 - Bug #769: Mathn's Rational#power2 is broken on 1.8.6 and 1.8.7Closed11/21/2008Actions

Associated revisions

Revision 15b183c2
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 20352
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

Revision 20352
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

Revision 20352
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

Revision 20352
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

Revision 20352
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

Revision 20352
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

Revision 5fe983bd
Added by yugui (Yuki Sonoda) over 10 years ago

merges r20352 from trunk into ruby_1_9_1.

  • strftime.c (FMT): use "%0d" formatter for zero padding, not "%.d".
    [ruby-dev:37168] fix: #768

  • strftime.c (rb_strftime): %s to use zero padding by default.
    [ruby-dev:37180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1

Updated by jredville (Jim Deville) over 10 years ago

=begin
This is a dup of 769. Please close.
=end

#2

Updated by matz (Yukihiro Matsumoto) over 10 years ago

  • Status changed from Open to Closed

=begin

=end

Also available in: Atom PDF