Skip to content

Division by zero #1109

@florin555

Description

@florin555

Is there a way to prevent division by zero?

I know there is a configuration for BigDecimal: BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, true).

That seems to have no effect on this: Money.new(1) / Money.new(0)

In addition, I would prefer to not have to change the behaviour of BigDecimal, as I don't know what other libraries might depend on that configuration. I would prefer to make the change at the money gem level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions