summaryrefslogtreecommitdiff
path: root/test/ruby/test_math.rb
AgeCommit message (Collapse)Author
2018-06-06math.c: adjust cbrtnobu
* math.c (math_cbrt): refine the approximation result on boundary values by an iteration of Newton-Raphson method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-02math.c: tanh overflownobu
* math.c (tanh): check overflows, and return +-1.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55798 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
2016-04-05math.c: fix lgammanobu
* math.c (ruby_lgamma_r): fix lgamma(-0.0) on mingw and OSX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-05math.c: fix tgammanobu
* math.c (ruby_tgamma): fix tgamma(-0.0) on mingw. [ruby-core:74817] [Bug #12249] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-22* test/ruby/test_math.rb: use 64 bits in test_override_bignum_to_fheadius
to ensure it's a bignum on all impls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-22* test/ruby/test_math.rb: override tests must always put to_f backheadius
Conflicts: test/ruby/test_math.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-19test/ruby: suppress runtime warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53873 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-03-16* math.c (math_log1, math_log2, math_log10): refactoringgogotanaka
and tests for this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-14* math.c (math_gamma): optimization for passed small integer.gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10test_math.rb: to_f testsnobu
* test/ruby/test_math.rb (test_{fixnum,bignum,rational}_to_f): refine to_f tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-04* test/ruby/test_math.rb (assert_float_and_int): Refactor test casesgogotanaka
by introducing assert_float_and_int. [misc #10810] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03* test/ruby/test_math.rb: add tests for the above change.gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-24* test/ruby/test_math.rb: Use assert_infinity instead of assert_equal(1.0/0, ↵gogotanaka
...). * test/ruby/test_math.rb: Add tests for overriding Integer#to_f. [ruby-core:67919] [Misc #10809] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-24* test/ruby/test_math.rb(test_cbrt): Add an assertion for Math.cbrt(1.0/0)gogotanaka
and move #test_cbrt to more proper place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-19test_math.rb: use Float#infinite?nobu
* test/ruby/test_math.rb (TestMath#assert_infinity): Float#finite? returns true also for NaN, so use Float#infinite? instead. [ruby-core:65117] [Feature #10261] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-04math.c: C99-like atan2nobu
* math.c (math_atan2): return values like as expected by C99 if both two arguments are infinity. based on the patch by cremno phobia <cremno AT mail.ru> in [ruby-core:62310]. [Feature #9799] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-03test_math.rb: rename check as assert_floatnobu
* test/ruby/test_math.rb (assert_float): rename with `assert_` prefix so that the caller frame would appear in backtraces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-03math.c: check domain of base argumentnobu
* math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45795 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
2013-09-28math.c: fix for Bignum argumentnobu
* math.c (math_log, math_log2, math_log10): fix for Bignum argument. numbits should be add only when right shifted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-27* math.c (math_atan2): change the behavior when x and y are zero.mrkn
* test/ruby/test_math.rb (test_atan2): add tests for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-06Surpress warnings.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-02* test/ruby/test_math.rb: Fix lgamma testmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28* math.c (rb_eMathDomainError): new exception class for representing ↵muraken
mathematical domain error instead of Errno::EDOM. * math.c (domain_check, infinity_check): removed, no longer needed. * math.c (math_atan2, math_acos, math_asin, math_acosh, math_atanh, math_log, math_log2, math_log10, math_sqrt, math_gamma, math_lgamma): mathematical domain errors are checked and raised before calling libm's functions. * test/ruby/test_math.rb: updated for changes of maht.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-04add assertion message.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-02* math.c (math_gamma): get rid of direct comparison between toonobu
big double and integer, with gcc on x86_64. [ruby-core:25257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-21 * math.c (math_log): should check argc.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28* math.c (math_atanh): raise EDOM on FreeBSD when atanh(1).naruse
* math.c (math_log): ditto. * math.c (math_log2): ditto. * math.c (math_log10): ditto. * test/ruby/test_math.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06* missing/lgamma_r.c (loggamma): return 0 for 1 and 2.akr
* test/ruby/test_math.rb: accept errors by functions under missing/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14* test/ruby/test_math.rb: actual-expected argument ordering formatz
test_math.rb fixed. a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp> in [ruby-dev:33770]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-09* test/ruby/test_math.rb: add tests for Math#gamma, Math#lgamma andmame
Math#cbrt, and use assert_in_delta instead of assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23* test/ruby/test_struct.rb: add tests to achieve over 90% testmame
coverage of struct.c. * test/ruby/test_sprintf.rb: ditto for sprintf.c. * test/ruby/test_math.rb: ditto for math.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-18 * test/*: should not depend on $KCODE.nahi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-05* lib/optparse.rb (OptionParser#order, #permute, #parse): allow annobu
array as argument. * test/ruby/test_*.rb: moved invariants to left side in assert_equal, and use assert_nil, assert_raises and so on. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-05* test/ruby/test_*.rb: replace 'assert(a == b)' with assert_equal(a, b)'nahi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-04* test/ruby: tests for ruby itself.nahi
* test/ruby/test_*.rb: split sample/test.rb into 28 test/unit testcases. some tests could not be translates... search '!!' mark to see it. * test/csv/test_csv.rb: should require 'csv', not '../lib/csv'. test runner should set load path correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e