diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-27 07:56:58 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-27 07:56:58 +0000 |
commit | 16c8a6d4b4588635a9009152392d62cc0f5d29c7 (patch) | |
tree | c077a1cde09239122f7b2aea2a79cba5a9e92b73 /test | |
parent | 2b4becd6bc377b23375b59a0d31afb2c559273b6 (diff) |
merge revision(s) 44588: [Backport #9316]
* ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additional
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/branches/ruby_2_1@44711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/bigdecimal/test_bigdecimal.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 6fdc422fdf..02bb5a5175 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -701,6 +701,10 @@ class TestBigDecimal < Test::Unit::TestCase assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, (BigDecimal.new("-0") / 1).sign) assert_equal(2, BigDecimal.new("2") / 1) assert_equal(-2, BigDecimal.new("2") / -1) + + assert_equal(BigDecimal('1486.868686869'), BigDecimal('1472.0') / BigDecimal('0.99'), '[ruby-core:59365] [#9316]') + + assert_equal(4.124045235, BigDecimal('0.9932') / (700 * BigDecimal('0.344045') / BigDecimal('1000.0')), '[#9305]') end def test_div_with_float |