diff options
author | Kenta Murata <mrkn@mrkn.jp> | 2022-01-19 15:53:36 +0900 |
---|---|---|
committer | Kenta Murata <mrkn@mrkn.jp> | 2022-01-24 10:56:30 +0900 |
commit | 7db195d521337f78b4477b5730514b78fad8d5a1 (patch) | |
tree | 48ab1db9c8899f64ad07e2c557c861cc00179a1a /test/bigdecimal/test_bigdecimal.rb | |
parent | 506728d0b86e2cd42cc5668ed417c4a870b40bb0 (diff) | |
download | ruby-7db195d521337f78b4477b5730514b78fad8d5a1.tar.gz |
[ruby/bigdecimal] Fix the maximum precision of the quotient
Fixes https://github.com/ruby/bigdecimal/pull/220
https://github.com/ruby/bigdecimal/commit/127a1b5a31
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r-- | test/bigdecimal/test_bigdecimal.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 11e6928283..0cd85249ad 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -973,6 +973,13 @@ class TestBigDecimal < Test::Unit::TestCase assert_raise_with_message(FloatDomainError, "Computation results in '-Infinity'") { BigDecimal("-1") / 0 } end + def test_div_gh220 + x = BigDecimal("1.0") + y = BigDecimal("3672577333.6608990499165058135986328125") + c = BigDecimal("0.272288343892592687909520102748926752911779209181321744700032723729015151607289998e-9") + assert_equal(c, x / y, "[GH-220]") + end + def test_div_precision bug13754 = '[ruby-core:82107] [Bug #13754]' a = BigDecimal('101') |