-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #595 : Numeric operator overflow #596
base: master
Are you sure you want to change the base?
Fix #595 : Numeric operator overflow #596
Conversation
If a maintainer could review everything, I've completed a significant change to the Binary Comparison and Operation methods in In all cases, the code only converts a number between types when necessary. For operands of differing types, it converts them to the highest complexity / scale type of the two. As a bonus, I also added BigInteger support. All unit tests complete successfully, but it may be a good idea to add another unit test similar to the comparison one I have that checks the arithmetic operation logic specifically. 100% code coverage there would not be a bad thing. |
… and Conversion
…o Type Checking
8b6f327
to
dc32712
Compare
/* | ||
* Convert and compare operands based on the complexity / scale of the values. | ||
*/ | ||
if (num1 instanceof BigDecimal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add tests when both operands are not the same type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also add tests for numeric operation (add, subtract, multiply, etc.)
Great PR, I'll gladly accept it when test coverage is gonna be better. Can you adjust it ? |
Hi @ebussieres , I somehow missed your comments but will review and see if I can find some time to add more test cases. |
@thecoden did you get to add more test cases? |
Initial pull request that just fixes the comparison operators and could be greatly improved by:
Fixes #595