[#319] Handle exception case of euclidean division in Michelson style
Description
Euclidean division operation divMich a b
performs division of a
and b
incorrectly when mod a b == 0
. It was described in one MR that integer division performances differ in Michelson and in Haskell. So when divisor is negative and divisible number is multiple of divisor, the results are equal in Michelson and in Haskell.
As a solution we need to handle this case in divMich
and don't change the result of div
if mod a b == 0
.
Related issue(s)
Resolves #319 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.