From ddda108ecce743ed9e1128d21518d015304dc67c Mon Sep 17 00:00:00 2001 From: yugui Date: Fri, 27 Nov 2009 02:55:16 +0000 Subject: merges r25067 from trunk into ruby_1_9_1 and added a test for it. -- * lib/mathn.rb (Bignum#**): Fixed bignum**fixnum that was broken when requiring lib/mathn [ruby-core:25740] -- * test/test_mathn.rb (TestMathn): new test case. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mathn.rb | 4 ++-- lib/rational.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/mathn.rb b/lib/mathn.rb index 0241f578e..780ecd6e7 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -25,7 +25,7 @@ class Fixnum remove_method :/ alias / quo - alias power! ** unless defined?(0.power!) + alias power! ** unless method_defined? :power! def ** (other) if self < 0 && other.round != other @@ -41,7 +41,7 @@ class Bignum remove_method :/ alias / quo - alias power! ** unless defined?(0.power!) + alias power! ** unless method_defined? :power! def ** (other) if self < 0 && other.round != other diff --git a/lib/rational.rb b/lib/rational.rb index 5acfa5433..8bed85618 100644 --- a/lib/rational.rb +++ b/lib/rational.rb @@ -3,7 +3,7 @@ class Fixnum alias quof fdiv alias rdiv quo - alias power! ** unless defined?(0.power!) + alias power! ** unless method_defined? :power! alias rpower ** end @@ -13,7 +13,7 @@ class Bignum alias quof fdiv alias rdiv quo - alias power! ** unless defined?(0.power!) + alias power! ** unless method_defined? :power! alias rpower ** end -- cgit