Skip to content

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

@michaelglass

Description

@michaelglass

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions