bigdecimal
bigdecimal copied to clipboard
I would expect BigDecimal#divmod to return type [Int, BigDecimal] (like Integer#divmod, Float#divmod)
Integer#divmod
returns type [Integer, Integer]
Float#divmod
returns type [Integer, Float]
BigDecimal#divmod
returns type [BigDecimal, BigDecimal]
Which feels surprising.
1.divmod(2)
=> [0, 1]
(1.0).divmod(2)
=> [0, 1.0]
BigDecimal(1).divmod(2)
=> [0.0, 0.1e1]
(thank you BigDecimal maintainers, you are wonderful)