diff options
| author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-22 12:27:54 +0000 |
|---|---|---|
| committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-22 12:27:54 +0000 |
| commit | 68808f529a0213ee155f27f3ea33b171a51f133b (patch) | |
| tree | 87500a4a23ee3748c74aff1f750eacef665b9cca /lib/complex.rb | |
| parent | 7fd8040c7817540f4175c13e6664a463cffdcbdb (diff) | |
| download | ruby-68808f529a0213ee155f27f3ea33b171a51f133b.tar.gz ruby-68808f529a0213ee155f27f3ea33b171a51f133b.tar.xz ruby-68808f529a0213ee155f27f3ea33b171a51f133b.zip | |
* complex.c (nucomp_div): now behaves as quo.
* complex.c (nucomp_s_generic_p): has been removed.
* complex.c (nucomp_to_s): adopts new form.
* complex.c (nucomp_inspect): ditto.
* complex.c (string_to_c_internal): ditto and supports polar form.
* complex.c (rb_complex_polar): new.
* rational.c (nurat_to_s): did not canonicalize.
* rational.c (nurat_inspect): adopts new form.
* rational.c (string_to_r_internal): ditto.
* include/ruby/intern.h: added a declaration.
* lib/complex.rb: added an obsolate class method.
* lib/cmath.rb: use scalar? instead of generic?.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/complex.rb')
| -rw-r--r-- | lib/complex.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/complex.rb b/lib/complex.rb index 0e88dd5f4..1845f30b1 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -2,3 +2,9 @@ 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 |
