summaryrefslogtreecommitdiff
path: root/test/ruby/test_complex.rb
AgeCommit message (Collapse)Author
2016-11-29get rid of ambiguous parentheses warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-24complex.c: undefine Comparable methodsnobu
* complex.c (Init_Complex): undefine methods inherited from Comparable, because Complex does not have <=> method. [Bug #12866] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-24refine assertionsnobu
* test/ruby/test_complex.rb, test/ruby/test_rational.rb: refine assertions for descriptive messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-24complex.c: undefine clampnobu
* complex.c (Init_Complex): undefine Complex#clamp, which does not work like other Comparable methods, because Complex does not have <=> method. patched by Tim Peters <zomg.tim AT gmail.com> in [ruby-core:77720]. [Bug #12866] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-17numeric.c, complex.c: Add finite? and infinite? consistent with Floatmrkn
* numeric.c (num_finite_p, num_infinite_p): Add Numeric#finite? and Numeric#infinite? [Feature #12039] [ruby-core:73618] * complex.c (rb_complex_finite_p): Add Complex#finite? * complex.c (rb_complex_infinite_p): Add Complex#infinite? * test/ruby/test_bignum.rb: Add test for Integer#finite? and Integer#infinite? * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_rational.rb: Add test for Rational#finite? and Rational#infinite? * test/ruby/test_complex.rb: Add test for Complex#finite? and Complex#infinite? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21hash method valuesnobu
* test/ruby/test_{complex,range,rational,struct}.rb (test_hash): hash values should be an Integer, not only a Fixnum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Use Integer instead of Fixnum and Bignum.akr
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
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
2015-09-28preserve encodings in error messagesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06* Move test cases from test/ruby/test_complex.rb to test/test_cmath.rbgogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-01test/ruby/test_complex.rb: Add test for CMath.log2gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22* complex.c (f_complex_polar): simple bug reproduced only when y isusa
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
2015-02-24* lib/cmath.rb (log): raise ArgumentError when more than 2 argumentsgogotanaka
are passed. [ruby-core:66143] [Bug #10487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-24complex.c: multiply as rotationnobu
* 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
2014-08-27* test/ruby/test_complex.rb: removed unreachable code.hsbt
* test/ruby/test_rational.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-26* test/ruby/test_complex.rb: cherry-picked working assertions from r47251.hsbt
* 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
2014-08-24* test/ruby/test_complex.rb: removed needless conditions.hsbt
* test/ruby/test_rational.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-22* test/ruby/test_complex.rb: removed commented-out code.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-22* test/ruby/test_complex.rb: fixed broken tests. Math is nothsbt
compatible CMath now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* 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
2012-11-17 * complex.c (make_patterns): should not accept extra sign.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-26test_complex.rb, test_rational.rb: revert some assertionsnobu
* 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
2012-07-25complex.c, rational.c: compatible marshal loadernobu
* 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
2012-06-22revert some teststadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-03 * complex.c: wrote Complex#_dump and Complex::load. But nowtadf
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
2012-06-03 * complex.c (nucomp_marshal_load): [ruby-core:45394]tadf
* rational.c (nurat_marshal_load): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12Exclude json/add/complex.rb.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-02* complex.c (nucomp_rationalize): fix function. [ruby-core:40667]nobu
[Bug #5546] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-10* complex.c (nucomp_rationalize): calls rationalize of real part ifmrkn
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
2011-05-09 * test/ruby/test_{complex,rational}.rb: added tests.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-09 * complex.c (string_to_c_internal): a refactoring.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-09* complex.c (string_to_c_internal): support scientific notation.mrkn
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
2010-11-22added some tests.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* complex.c (nucomp_marshal_load): should check the argument.nobu
[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
2010-01-26suppress warnings.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-26* test/ruby/test_complex.rb (@unify): fix the detection if mathyugui
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
2009-07-25* complex.c (nucomp_hash), rational.c (nurat_hash): not to usenobu
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
2009-07-03 * complex.c (nucomp_equal_p): removed.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-03 * rational.c: renamed equal_p to eqeq_p.tadf
* 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
2009-07-03 * complex.c: undef-ed shome methods. [ruby-core:24110]tadf
* 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
2009-06-18 * rational.c (nurat_s_convert): calls to_r when the given argumenttadf
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
2009-06-16 * complex.c (nucomp_coerce): accepts Complex instances.tadf
* 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
2009-06-07removed extra spaces.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 * test/ruby/test_complex.rb: added some tests.tadf
* test/ruby/test_rational.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 * complex.c (nurat_{to_s,inspect}): provides better representationtadf
for in-finite imag part. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-10trivial changes.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 * complex.c (nucomp_s_canonicalize_internal): does no applytadf
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
2008-09-21 * complex.c (nucomp_s_canonicalize_internal): checks exactness oftadf
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
2008-09-20 * complex.c: an instance method image has been removed andtadf
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
2008-09-19* prec.c: removed. Precision will be redesigned and be back again.yugui
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