diff options
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r-- | test/bigdecimal/test_bigdecimal.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 16f5505706..91cf7288e9 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -1495,16 +1495,17 @@ class TestBigDecimal < Test::Unit::TestCase end def test_limit - BigDecimal.limit(1) - x = BigDecimal("3") - assert_equal(90, x ** 4) # OK? must it be 80? - # 3 * 3 * 3 * 3 = 10 * 3 * 3 = 30 * 3 = 90 ??? - assert_raise(ArgumentError) { BigDecimal.limit(-1) } - - bug7458 = '[ruby-core:50269] [#7458]' - one = BigDecimal('1') - epsilon = BigDecimal('0.7E-18') BigDecimal.save_limit do + BigDecimal.limit(1) + x = BigDecimal("3") + assert_equal(90, x ** 4) # OK? must it be 80? + # 3 * 3 * 3 * 3 = 10 * 3 * 3 = 30 * 3 = 90 ??? + assert_raise(ArgumentError) { BigDecimal.limit(-1) } + + bug7458 = '[ruby-core:50269] [#7458]' + one = BigDecimal('1') + epsilon = BigDecimal('0.7E-18') + BigDecimal.limit(0) assert_equal(BigDecimal("1.0000000000000000007"), one + epsilon, "limit(0) #{bug7458}") |