summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mathn.rb4
-rw-r--r--lib/rational.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb
index 0241f578e9..780ecd6e7c 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 5acfa5433d..8bed856187 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