Fix #595 : Numeric operator overflow#596
Fix #595 : Numeric operator overflow#596codesplode wants to merge 8 commits intoPebbleTemplates:masterfrom
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. |
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.
Need to add tests when both operands are not the same type
There was a problem hiding this comment.
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? |
… and Conversion
…o Type Checking
dc32712 to
a5d9195
Compare
Initial pull request that just fixes the comparison operators and could be greatly improved by:
Fixes #595