summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-05 12:30:54 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-05 12:30:54 +0000
commitc16b63d50e815ddcbc7b7932f01f5caf5c946d81 (patch)
treef3c6db0a552cff4154c767c46464182763ae7750 /lib
parentbe7d2d03475df3d58bffc70fb7da9216aaed7321 (diff)
downloadruby-c16b63d50e815ddcbc7b7932f01f5caf5c946d81.tar.gz
ruby-c16b63d50e815ddcbc7b7932f01f5caf5c946d81.tar.xz
ruby-c16b63d50e815ddcbc7b7932f01f5caf5c946d81.zip
* lib/rational.rb: resolved conflicts of aliases.
* lib/mathn.rb: avoided some warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mathn.rb14
-rw-r--r--lib/rational.rb4
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb
index a4a006e2d..992eae709 100644
--- a/lib/mathn.rb
+++ b/lib/mathn.rb
@@ -59,9 +59,9 @@ class Fixnum
remove_method :/
alias / quo
- def_canon *(instance_methods - Object.methods - [:canon])
+ def_canon(*(instance_methods - Object.methods - [:canon]))
- alias power! **
+ alias power! ** unless defined?(0.power!)
def ** (other)
if self < 0 && other.round != other
@@ -77,9 +77,9 @@ class Bignum
remove_method :/
alias / quo
- def_canon *(instance_methods - Object.methods - [:canon])
+ def_canon(*(instance_methods - Object.methods - [:canon]))
- alias power! **
+ alias power! ** unless defined?(0.power!)
def ** (other)
if self < 0 && other.round != other
@@ -104,7 +104,7 @@ class Rational
def convert(*args) convert_orig(*args).__send__(:canon) end
end
- def_canon *(instance_methods - Object.methods - [:canon])
+ def_canon(*(instance_methods - Object.methods - [:canon]))
alias power! **
@@ -257,7 +257,7 @@ class Complex
def convert(*args) convert_orig(*args).__send__(:canon) end
end
- def_canon *(instance_methods - Object.methods - [:canon])
+ def_canon(*(instance_methods - Object.methods - [:canon]))
end
@@ -281,7 +281,7 @@ end
class Float
- def_canon *(instance_methods - Object.methods - [:canon])
+ def_canon(*(instance_methods - Object.methods - [:canon]))
alias power! **
diff --git a/lib/rational.rb b/lib/rational.rb
index 4b39f8315..5acfa5433 100644
--- a/lib/rational.rb
+++ b/lib/rational.rb
@@ -3,7 +3,7 @@ class Fixnum
alias quof fdiv
alias rdiv quo
- alias power! **
+ alias power! ** unless defined?(0.power!)
alias rpower **
end
@@ -13,7 +13,7 @@ class Bignum
alias quof fdiv
alias rdiv quo
- alias power! **
+ alias power! ** unless defined?(0.power!)
alias rpower **
end