aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_complex.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* preserve encodings in error messagesnobu2015-09-281-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Move test cases from test/ruby/test_complex.rb to test/test_cmath.rbgogotanaka2015-06-061-104/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_complex.rb: Add test for CMath.log2gogotanaka2015-06-011-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (f_complex_polar): simple bug reproduced only when y isusa2015-05-221-0/+1
| | | | | | | a float but x is not a float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cmath.rb (log): raise ArgumentError when more than 2 argumentsgogotanaka2015-02-241-3/+3
| | | | | | are passed. [ruby-core:66143] [Bug #10487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: multiply as rotationnobu2015-02-241-0/+7
| | | | | | | * complex.c (nucomp_mul): calculate as rotation in complex plane if matrix calculation resulted in NaN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_complex.rb: removed unreachable code.hsbt2014-08-271-64/+30
| | | | | | * test/ruby/test_rational.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_complex.rb: cherry-picked working assertions from r47251.hsbt2014-08-261-0/+6
| | | | | | * test/ruby/test_rational.rb: cherry-picked working assertions from r47263. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_complex.rb: removed needless conditions.hsbt2014-08-241-122/+58
| | | | | | * test/ruby/test_rational.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_complex.rb: removed commented-out code.hsbt2014-08-221-58/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_complex.rb: fixed broken tests. Math is nothsbt2014-08-221-28/+29
| | | | | | compatible CMath now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: better assertionsnobu2013-12-131-13/+13
| | | | | | * test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (make_patterns): should not accept extra sign.tadf2012-11-171-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_complex.rb, test_rational.rb: revert some assertionsnobu2012-07-261-1/+6
| | | | | | | | * test_complex.rb, test_rational.rb: revert some assertions, but just assert that a frozen object cannot be modified with marshal_load. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c, rational.c: compatible marshal loadernobu2012-07-251-7/+8
| | | | | | | | * complex.c, rational.c: compatible marshal loader for compatibilities with 1.8. [ruby-core:45775] [Bug #6625] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert some teststadf2012-06-221-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: wrote Complex#_dump and Complex::load. But nowtadf2012-06-031-0/+2
| | | | | | | | | disabled (due to compatibility) [experimental]. * rational.c: wrote Rational#_dump and Rational::load. ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_marshal_load): [ruby-core:45394]tadf2012-06-031-0/+5
| | | | | | | * rational.c (nurat_marshal_load): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Exclude json/add/complex.rb.naruse2012-03-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_rationalize): fix function. [ruby-core:40667]nobu2011-11-021-0/+1
| | | | | | [Bug #5546] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_rationalize): calls rationalize of real part ifmrkn2011-08-101-0/+5
| | | | | | | | | | | imaginary part is exactly zero. The patch is made by Marc-Andre Lafortune. fixes [Bug #5178] [ruby-core:38885] * test/ruby/test_complex.rb (test_rationalize): add a test for the above change. * complex.c (nucomp_to_r): fix RDoc comment. The patch is made by Marc-Andre Lafortune. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_{complex,rational}.rb: added tests.tadf2011-05-091-0/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (string_to_c_internal): a refactoring.tadf2011-05-091-4/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (string_to_c_internal): support scientific notation.mrkn2011-05-091-0/+4
| | | | | | | patched by Tinco Andringa. https://github.com/ruby/ruby/pull/16 [ruby-core:36046][Bug #4655] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* added some tests.tadf2010-11-221-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_marshal_load): should check the argument.nobu2010-08-051-0/+5
| | | | | | | | | [ruby-core:31622] * rational.c (nurat_marshal_load): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warnings.akr2010-01-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@24270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_equal_p): removed.tadf2009-07-031-12/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@23718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* removed extra spaces.tadf2009-06-071-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* trivial changes.tadf2008-11-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c: removed unused code.tadf2008-09-071-4/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: uses f_real_p macro.tadf2008-09-051-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e