summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_complex.rb
Commit message (Collapse)AuthorAgeFilesLines
* * test/ruby/test_complex.rb (@unify): fix the detection if mathyugui2009-11-261-1/+2
| | | | | | | | | loaded. This makes test_complex.rb work fine with the previous commit. * test/ruby/test_rational.rb (@unify): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_hash), rational.c (nurat_hash): not to usenobu2009-07-251-0/+3
| | | | | | | | hash value of class so that equality against subclasses can work. [ruby-dev:38850] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_equal_p): removed.tadf2009-07-031-12/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c: renamed equal_p to eqeq_p.tadf2009-07-031-0/+19
| | | | | | | | | | | * complex.c: ditto. * complex.c (nucomp_equal_p): added. Complex(NaN).equal?(Complex(NaN)) should return true. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: undef-ed shome methods. [ruby-core:24110]tadf2009-07-031-2/+4
| | | | | | | | * complex.c (Numeric#arg): NaN for NaN. [ruby-core:24116] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c (nurat_s_convert): calls to_r when the given argumenttadf2009-06-181-2/+2
| | | | | | | | | | | is non-integer. * rational.c (nurat_s_convert): raises TypeError when the given argument is nil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_coerce): accepts Complex instances.tadf2009-06-161-0/+8
| | | | | | | | | * rational.c (nurat_coerce): accepts Rational instances. [ruby-core:23859] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* removed extra spaces.tadf2009-06-071-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_complex.rb: added some tests.tadf2008-12-041-1/+28
| | | | | | | | * test/ruby/test_rational.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nurat_{to_s,inspect}): provides better representationtadf2008-12-031-0/+10
| | | | | | | | for in-finite imag part. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* trivial changes.tadf2008-11-101-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_s_canonicalize_internal): does no applytadf2008-09-231-88/+21
| | | | | | | | | | | | | | canonicalization rule anymore. * rational.c (nurat_s_canonicalize_internal(_no_reduce)?): ditto. * complex.c: removed class method new! and new. * rational.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_s_canonicalize_internal): checks exactness oftadf2008-09-211-34/+46
| | | | | | | | | | | | | imag only. * rational.c (nurat_s_convert): accepts non real value (Rational(a,b) as a/b). * complex.c (nucomp_s_convert): refined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: an instance method image has been removed andtadf2008-09-201-97/+84
| | | | | | | | | | | | | | | | | | | | | | uses "imag" instead of "image". * complex.c: two instance method re and im are removed. * rational.c: follows the above changes. * include/ruby/ruby.h: ditto. * gc.c: ditto. * lib/cmath.rb: ditto. * lib/mathn.rb: ditto. * lib/complex.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prec.c: removed. Precision will be redesigned and be back again.yugui2008-09-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c.f. [ruby-dev:36352]. * common.mk (COMMON_OBJS): removed prec.o. * inits.c (rb_call_inits): removed Init_Precision. * numeric.c (Init_Numeric): removed inclusion of Precision. removed #induced_from from each class. * rational.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * lib/rdoc/knwon_classes.rb: removed the entry for Precision. * test/ruby/test_prec.rb: removed. * test/ruby/test_integer.rb: removed tests for Precision. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_rational.rb: ditto. * test/ruby/test_complex.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_s_convert): accepts complextadf2008-09-171-1/+4
| | | | | | | | value (Complex(a,b) as a+bi). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c: provides predicate real? instead of scalar?.tadf2008-09-161-4/+6
| | | | | | | | | | * complex.c: follows the above change. * lib/cmath.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_marshal_{dump,load}): preserve instancetadf2008-09-161-0/+2
| | | | | | | | | | variables. * rational.c (nurat_marshal_{dump,load}): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_eql_p): new.tadf2008-09-151-0/+4
| | | | | | | | | | * complex.c (nucomp_hash): should use hash values of the elements. * rational.c (nurat_hash): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (f_{add,mul,sub}): omitted some shortcuts for preservetadf2008-09-141-0/+20
| | | | | | | | | | signed zero anyway. * complex.c (nucomp_negate): new. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c: removed unused code.tadf2008-09-071-4/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: uses f_real_p macro.tadf2008-09-051-0/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (numeric_abs2): new.tadf2008-08-311-0/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c: added a static variable for nurat_to_f.tadf2008-08-301-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* removed some lines which gain the score of coverage.tadf2008-08-291-126/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c ({nucomp,numeric}_rect): new.tadf2008-08-291-39/+59
| | | | | | | | | | | | | | | | | | | | | | | * complex.c: added some aliases (::rectangular, ::rect, #rectangular, #rect, #phase, #magnitude). * complex.c (string_to_c_internal): should not strip any null bytes. * rational.c (string_to_r_internal): ditto. * rational.c (i_gcd): reverted to nurat 0.0.2's one. * numeric.c: added an alias (#magnitude). * test/ruby/test_complex.rb: added assertions. * test/ruby/test_rational.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_div): now behaves as quo.tadf2008-08-221-36/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * complex.c (nucomp_div): [ruby-dev:34357]tadf2008-04-141-0/+2
| | | | | | | | | | | | * complex.c (nucomp_abs): use hypot. * complex.c (nucomp_quo): do not force convertion. * test/ruby/test_complex.rb: omitted some meaningless tests. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (Init_Bignum): rdiv method removed. [ruby-dev:34242]matz2008-04-031-28/+4
| | | | | | | | | | | | * complex.c (nucomp_quo): ditto. * numeric.c (num_rdiv): ditto. * rational.c (nurat_div): ditto. * complex.c (nucomp_fdiv): fdiv implementation restored. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* anyway renamed.tadf2008-03-261-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_rational.rb: add tests to achieve over 90% testmame2008-03-251-1/+126
| | | | | | | | | coverage of rational.c. * test/ruby/test_complex.rb: ditto for complex.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fixed. [ruby-dev:34109]tadf2008-03-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* both complex and rational are now builtin classes.tadf2008-03-161-0/+1017
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e