You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: