mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
BigDecimal('0.') with bigdecimal-3.1.9 returns 0.0
This commit is contained in:
parent
b82ad36d7c
commit
175770bb6c
Notes:
git
2024-12-28 02:19:12 +00:00
1 changed files with 5 additions and 1 deletions
|
@ -98,7 +98,11 @@ describe "Kernel#BigDecimal" do
|
||||||
BigDecimal("invalid", exception: false).should be_nil
|
BigDecimal("invalid", exception: false).should be_nil
|
||||||
BigDecimal("0invalid", exception: false).should be_nil
|
BigDecimal("0invalid", exception: false).should be_nil
|
||||||
BigDecimal("invalid0", 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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue