diff options
Diffstat (limited to 'trunk/lib/complex.rb')
-rw-r--r-- | trunk/lib/complex.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/trunk/lib/complex.rb b/trunk/lib/complex.rb new file mode 100644 index 0000000000..1845f30b1f --- /dev/null +++ b/trunk/lib/complex.rb @@ -0,0 +1,10 @@ +require 'cmath' + +Object.instance_eval{remove_const :Math} +Math = CMath + +def Complex.generic? (other) + other.kind_of?(Integer) || + other.kind_of?(Float) || + other.kind_of?(Rational) +end |