diff options
author | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-22 12:40:45 +0000 |
---|---|---|
committer | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-22 12:40:45 +0000 |
commit | 8b53e39a2e6110cf13827c88673a3ef2667991cf (patch) | |
tree | eb1fa37c2a675b75c295285b5c313ba05801c2b8 /lib/complex.rb | |
parent | f36a3f0ea57aa05a72cb58937c7a737455a98a38 (diff) | |
download | ruby-rexml_adds_tests.tar.gz |
Second merge from trunk.rexml_adds_tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/rexml_adds_tests@19455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/complex.rb')
-rw-r--r-- | lib/complex.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/complex.rb b/lib/complex.rb index 1845f30b1f..301879143f 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -1,10 +1,24 @@ 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) || other.kind_of?(Float) || other.kind_of?(Rational) end + +class Complex + + alias image imag + +end + +class Numeric + + def im() Complex(0, self) end + +end |