Euclidean division implementation and comparsion with the C++ truncated definition (since C++11).
This still leaves a sign ambiguity if the remainder is non-zero: two possible choices for the remainder occur, one negative and the other positive, and two possible choices for the quotient occur.
According to the number theory the positive remainder is always chosen (wiki)
So, considering the positive remainder, the difference only occurs when
For
Input absolute values, the resulting table will include all combinations of negative and positive quotients and remainders.
https://en.wikipedia.org/wiki/Modulo
https://en.wikipedia.org/wiki/Euclidean_division
http://www.cristinagreen.com/tag/c.html
https://copyprogramming.com/howto/why-does-c-output-negative-numbers-when-using-modulo