ruby-changes:5065
From: akr <ko1@a...>
Date: Sat, 24 May 2008 00:53:56 +0900 (JST)
Subject: [ruby-changes:5065] Ruby:r16560 (ruby_1_8): * lib/rational.rb (Rational#to_i): fix rdoc. Rational(-7,4).to_i
akr 2008-05-24 00:36:04 +0900 (Sat, 24 May 2008) New Revision: 16560 Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/lib/rational.rb Log: * lib/rational.rb (Rational#to_i): fix rdoc. Rational(-7,4).to_i should be -1. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16560&r2=16559&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/rational.rb?r1=16560&r2=16559&diff_format=u Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 16559) +++ ruby_1_8/ChangeLog (revision 16560) @@ -1,3 +1,8 @@ +Sat May 24 00:34:59 2008 Tanaka Akira <akr@f...> + + * lib/rational.rb (Rational#to_i): fix rdoc. Rational(-7,4).to_i + should be -1. + Fri May 23 16:46:28 2008 Akinori MUSHA <knu@i...> * enumerator.c (proc_call): Remove an unused static function. Index: ruby_1_8/lib/rational.rb =================================================================== --- ruby_1_8/lib/rational.rb (revision 16559) +++ ruby_1_8/lib/rational.rb (revision 16560) @@ -344,12 +344,12 @@ # Converts the rational to an Integer. Not the _nearest_ integer, the # truncated integer. Study the following example carefully: # Rational(+7,4).to_i # -> 1 - # Rational(-7,4).to_i # -> -2 + # Rational(-7,4).to_i # -> -1 # (-1.75).to_i # -> -1 # # In other words: # Rational(-7,4) == -1.75 # -> true - # Rational(-7,4).to_i == (-1.75).to_i # false + # Rational(-7,4).to_i == (-1.75).to_i # -> true # -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/