Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Division by zero #1109

Open
florin555 opened this issue Jul 16, 2024 · 0 comments
Open

Division by zero #1109

florin555 opened this issue Jul 16, 2024 · 0 comments

Comments

@florin555
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant