BigDecimal('0.') with bigdecimal-3.1.9 returns 0.0

This commit is contained in:
Hiroshi SHIBATA 2024-12-27 16:43:32 +09:00
parent b82ad36d7c
commit 175770bb6c
Notes: git 2024-12-28 02:19:12 +00:00

View File

@ -98,7 +98,11 @@ describe "Kernel#BigDecimal" do
BigDecimal("invalid", exception: false).should be_nil
BigDecimal("0invalid", exception: false).should be_nil
BigDecimal("invalid0", exception: false).should be_nil
BigDecimal("0.", exception: false).should be_nil
if BigDecimal::VERSION >= "3.1.9"
BigDecimal("0.", exception: false).to_i.should == 0
else
BigDecimal("0.", exception: false).should be_nil
end
end
end