Actions
Bug #12952
closedIncompatibility of a method signature between `Float#round` and `BigDecimal#round`
Description
We can not call BigDecimal("0.5").round(half: :up)
.
This prevents us from duck typing Float objects and BigDecimal objects.
irb(main):001:0> require "bigdecimal"
=> true
irb(main):002:0> 0.5.round(half: :up)
=> 1
irb(main):003:0> BigDecimal("0.5").round(half: :up)
TypeError: no implicit conversion of Hash into Integer
from (irb):3:in `round'
from (irb):3
from /Users/kaneko/.rbenv/versions/2.4.0-preview3/bin/irb:11:in `<main>'
irb(main):004:0> BigDecimal.ver
=> "1.1.0"
Actions
Like0
Like0Like0Like0Like0