There are two ways to fix this.. Either a new error is being introduced (Overflow exception) or we catch these particular cases and make them overflow correctly..
I've chosen the latter one, simply because it's the easiest one and a new error type would probably not be very useful..
Because I couldn't separate the / sign from % sign in the DIVISION_OP macro, I had to split it in two functions.. Anyone that has a better solution is invited to come up with a patch!
Anyway, the fix is included and has been tested!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is some background info on why this is happening:
http://ericlippert.com/2013/01/28/integer-division-that-rounds-up/
Patch
There are two ways to fix this.. Either a new error is being introduced (Overflow exception) or we catch these particular cases and make them overflow correctly..
I've chosen the latter one, simply because it's the easiest one and a new error type would probably not be very useful..
Because I couldn't separate the / sign from % sign in the DIVISION_OP macro, I had to split it in two functions.. Anyone that has a better solution is invited to come up with a patch!
Anyway, the fix is included and has been tested!