[FIX] Division for zero quotient with either a negative divisor or dividend#246
Open
jmalovera10 wants to merge 5 commits intoelixirmoney:masterfrom
Conversation
Sync main
* Fix the case when just one from the dividend and divisor is negative and the quotient is 0 with a remainter greater than 0
…-dividend-negative' of https://github.com/jmalovera10/money into fix/division-for-zero-quotient-with-either-a-divisor-or-dividend-negative
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is done?
This PR aims to solve the issue #236. It handles the case in which either the divisor or the dividend are negative and the value is 0 and
dividend < divisorwhich results in a division under the current currency precision. To illustrate the change, here is an example of the behavior before:And the behavior after:
Also more thorough tests are added on negative values division to ensure proper behavior.