diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 07:52:17 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 07:52:17 +0000 |
commit | 2043bb5c3449e7bdb285a7178b934c3c2b68d733 (patch) | |
tree | 03833cb82220ff2159f3257e5a391bcc72ed6695 /test/bigdecimal/test_bigdecimal.rb | |
parent | c91ec25d19d0b0c2ecae1de8facb779d80665c78 (diff) | |
download | ruby-2043bb5c3449e7bdb285a7178b934c3c2b68d733.tar.gz |
* ext/bigdecimal/bigdecimal.c (BigDecimal_power): Round the result value.
[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
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r-- | test/bigdecimal/test_bigdecimal.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 78ecd8bd30..8eb732aca1 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -1123,6 +1123,9 @@ class TestBigDecimal < Test::Unit::TestCase e = BigDecimal("2.71828182845904523536028747135266249775724709369996") pow = BigDecimal("22.459157718361045473") assert_equal(pow, pi.power(e, 20)) + + b = BigDecimal('1.034482758620689655172413793103448275862068965517241379310344827586206896551724') + assert_equal(BigDecimal('0.114523E1'), b.power(4, 5), '[Bug #8818] [ruby-core:56802]') end def test_limit |