bigdecimal icon indicating copy to clipboard operation
bigdecimal copied to clipboard

I would expect BigDecimal#divmod to return type [Int, BigDecimal] (like Integer#divmod, Float#divmod)

Open michaelglass opened this issue 1 year ago • 0 comments

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)

michaelglass avatar May 17 '23 20:05 michaelglass