diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/complex.rb | 6 | ||||
-rw-r--r-- | lib/mathn.rb | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/complex.rb b/lib/complex.rb index 1845f30b1f..70e168e912 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -1,7 +1,9 @@ require 'cmath' -Object.instance_eval{remove_const :Math} -Math = CMath +unless defined?(Math.exp!) + Object.instance_eval{remove_const :Math} + Math = CMath +end def Complex.generic? (other) other.kind_of?(Integer) || diff --git a/lib/mathn.rb b/lib/mathn.rb index 2af2b83da3..b29f994ac9 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -9,11 +9,15 @@ # # -require "complex.rb" -require "rational.rb" +require "cmath.rb" require "matrix.rb" require "prime.rb" +unless defined?(Math.exp!) + Object.instance_eval{remove_const :Math} + Math = CMath +end + class Fixnum remove_method :/ alias / quo |