summaryrefslogtreecommitdiff
path: root/test/bigdecimal
AgeCommit message (Collapse)Author
2017-04-21Removed mathn.rb from stdlib. It's deprecated from Ruby 2.2.hsbt
[Feature #10169][[ruby-core:64553]] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-13bigdecimal: version 1.3.2mrkn
Import bigdecimal version 1.3.2. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.1...v1.3.2 This fixes [ruby-core:79603] [Bug #13232] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-10bigdecimal: version 1.3.1mrkn
Import bigdecimal version 1.3.1. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.0...v1.3.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-21bigdecimal: version 1.3.0mrkn
Import bigdecimal version 1.3.0. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.0.pre.2...v1.3.0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-10bigdecimal: version 1.3.0.pre.2mrkn
Import bigdecimal version 1.3.0.pre.2. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.0.pre...v1.3.0.pre.2 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-10bigdecimal: import version 1.3.0.premrkn
Import bigdecimal version 1.3.0.pre. The full commit log of this changes can be found at: https://github.com/ruby/bigdecimal/compare/5c43a9e...v1.3.0.pre git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-04bigdecimal.c: more precisionnobu
* ext/bigdecimal/bigdecimal.c (BigDecimal_div2): need more room for precision to round. [ruby-core:77475] [Bug #12805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23bigdecimal.c: fix FloatDomainErrornobu
* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider non-finite float values not to raise FloatDomainError. [ruby-core:75682] [Bug #12414] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55123 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-05-27test_bigdecimal.rb: adjustnobu
* test/bigdecimal/test_bigdecimal.rb (assert_no_memory_leak): fix GC scope and adjust limits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27bigdecimal.c: wrapper object before allocnobu
* ext/bigdecimal/bigdecimal.c (VpNewRbClass): make wrapper object before result structs allocation and manage refcount for each elements to get rid of potential memory leak. * ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/bigdecimal/test_bigdecimal.rb: Add test for mult by nil.headius
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13* ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additionalmrkn
digit for the quotient to be compatible with bigdecimal 1.2.1 and the former. [ruby-core:59365] [#9316] [#9305] * test/bigdecimal/test_bigdecimal.rb: tests for the above change. * ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12test_bigmath.rb: ignore on unrelated platformsnobu
* test/bigdecimal/test_bigmath.rb (test_log): ignore the result of log which is not a finite number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-11test_bigmath.rb: r44558nobu
* test/bigdecimal/test_bigmath.rb (test_log): add assertion for r44558. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-11test_bigmath.rb: test_lognobu
* test/bigdecimal/test_bigmath.rb (test_log): add basic test for BigMath.log. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12* ext/bigdecimal/bigdecimal.c (VpSetPTR): fix for limitation of the resultingmrkn
precision. * test/bigdecimal/test_bigdecimal.rb (test_limit): add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08* bigdecimal.c (BigDecimal_coerce): convert a Float to a BigDecimal insteadmrkn
of converting the receiver to a Float. [ruby-core:58756] [Bug #9192] * test/bigdecimal/test_bigdecimal.rb: add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec):mrkn
treat 0.0 and -0.0 of floating-point numbers specially for an optimization and to correctly propagate its signbit to the result. [Bug #9214] [ruby-core:58858] * test/bigdecimal/test_bigdecimal.rb: add tests case for the above change. * test/bigdecimal/test_bigdecimal_util.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.c (BigDecimal_power): Round the result value.mrkn
[Bug #8818] [ruby-core:56802] * test/bigdecimal/test_bigdecimal.rb: Add a test for the above fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21* ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix the precision ofmrkn
the result BigDecimal of sqrt. [Bug #5266] [ruby-dev:44450] * test/bigdecimal/test_bigdecimal.rb: add tests for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-18* test/bigdecimal/test_bigdecimal.rb: incorporate BigMath.logheadius
tests from JRuby by Peter Vandenabeele. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25* ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases whenmrkn
the argument x is not a BigDecimal. This change is based on the patch made by Garth Snyder. [Fix GH-332] https://github.com/ruby/ruby/pull/332 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04* ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the numbermrkn
of figures. Patch by Vipul A M <vipulnsward@gmail.com>. https://github.com/ruby/ruby/pull/323 fix GH-323 * test/bigdecimal/test_bigdecimal_util.rb: fix for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13* ext/bigdecimal/bigdecimal.c (BigDecimal_sub):mrkn
need to specify precision for converting Rational and Float. [ruby-dev:46544] [Bug #7404] * ext/bigdecimal/bigdecimal.c (BigDecimal_mult): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_divremain): ditto. * test/bigdecimal/test_bigdecimal.rb: add tests for the above fixes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07* ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal):mrkn
add RB_GC_GUARD to prevent the immediate object is GCed too early. This patch was made by Yusuke Endoh. [Bug #7044] [ruby-core:47632] * test/bigdecimal/test_bigdecimal.rb: add a reproduction test for the issue [Bug #7044] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-02* ext/bigdecimal/bigdecimal.c (BigDecimal_new): stop checking stringmrkn
taintness. [Bug #5508] [ruby-core:40510] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-01* ext/bigdecimal/bigdecimal.c (BigDecimal_new),mrkn
test/bigdecimal/test_bigdecimal.rb: Fix exception message of BigDecimal constructor with a Float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-01* ext/bigdecimal/bigdecimal.c (BigDecimal_add),mrkn
test/bigdecimal/test_bigdecimal.rb: need to specify precision for converting Rational and Float. [ruby-core:48045] [Bug #7176] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31* test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_to_f): addedusa
for previous commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-30bigdecimal.c: check underflownobu
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): check underflow since strtod() sets errno to ERANGE at underflow too. [ruby-core:47342] [Bug #6944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-11Add a test: BigDecimal("0").div(BigDecimal("Infinity")).naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07* ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs beforenaruse
they are used. [ruby-core:44900] [Bug #6406] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-18Run separate process if the test uses GC.stress.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methodsnobu
can be overridden, so should not make an assumption on the type of results. [ruby-core:42969][Bug #6093] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21* ext/bigdecimal/bigdecimal.c (BigDecimal_s_allocate): follownobu
Allocation Framework. [Bug #5775] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18* ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follownobu
allocation framework right now. [ruby-core:41710] [Bug #5773] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-17Merge branch '5172_bigdecimal_gc_issue' into trunkmrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30* test/bigdecimal/test_bigdecimal.rb (test_version): removed.mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26* ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):mrkn
zero or negative precision is error. fixes #5098. [ruby-dev:44210] * test/bigdecimal/test_bigdecimal_util.rb: add test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26* ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified formrkn
specifying precision. fixes #5098. [ruby-dev:44210] * test/bigdecimal/test_bigdecimal_util.rb: add test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26* ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): addedmrkn
for symmetry to BigDecimal() function with an Integer. fixes #5098. [ruby-dev:44210] * test/bigdecimal/test_bigdecimal_util.rb: add test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26* ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): addedmrkn
for adapting other Numeric subclasses. [ruby-dev:44245] * test/bigdecimal/test_bigdecimal_util.rb: test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26* bigdecimal/bigdecimal.c (VpDup) a new function for duplicatingmrkn
a BigDecimal. * bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new BigDecimal from another BigDecimal using BigDecimal global function or constructor. [ruby-dev:44245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10* ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): fixmrkn
precision treatment errors. * test/bigdecimal/test_bigdecimal.rb: add tests for the above change. fix precision treatment errors. * ext/bigdecimal/bigdecimal.c (BigDecimal_power): precision argument should be optional for its compatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10* ext/bigdecimal/bigdecimal.c (BigDecimal_power): support non-integralmrkn
exponent. fixes #3271 * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_power_op): add a function to only use for "**" operator. * test/bigdecimal/test_bigdecimal.rb: add a bunch of tests for the above changes. * ext/bigdecimal/bigdecimal.c (is_integer): add an utility function. * ext/bigdecimal/bigdecimal.c (is_negative): ditto. * ext/bigdecimal/bigdecimal.c (is_positive): ditto. * ext/bigdecimal/bigdecimal.c (is_zero): ditto. * ext/bigdecimal/bigdecimal.c (is_one): ditto. * ext/bigdecimal/bigdecimal.c (is_even): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-27* ext/bigdecimal/bigdecimal.c (BigMath_s_log): move BigMath.log frommrkn
bigdecimal/math.rb. * ext/bigdecimal/lib/bigdecimal/math.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: move test for BigMath.log from test/bigdecimal/test_bigmath.rb. * test/bigdecimal/test_bigmath.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* ext/bigdecimal/bigdecimal.c (BigMath_s_exp): move BigMath.exp frommrkn
bigdecimal/math.rb. * ext/bigdecimal/lib/bigdecimal/math.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: move test for BigMath.exp from test/bigdecimal/test_bigmath.rb. * test/bigdecimal/test_bigmath.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13* ext/bigdecimal/bigdecimal.c (BigDecimalCmp): use GetVpValueWithPrecmrkn
for Float and Rational arguments. * test/bigdecimal/test_bigdecimal.rb (test_new, test_cmp, test_power): add and modify tests for the above change. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): modify coding style to match ruby's standard. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e