2 ms·
> Modulo and remainder are not the same operation, so both python and C are correct That just makes C look worse. Remainders are always nonnegative, as specifi
by thaumasiotes 5y ago
> Modulo and remainder are not the same operation, so both python and C are correct
That just makes C look worse. Remainders are always nonnegative, as specified in the Division Algorithm [note that the Division Algorithm is the name of a theorem, not an algorithm].
https://en.wikipedia.org/wiki/Euclidean_division https://en.wikipedia.org/wiki/Euclidean_division
Also, I'm not aware of a definition of "modulo" other than "remainder". Where are you getting the idea that they're different?
For example, https://en.wikipedia.org/wiki/Modulo_operation https://en.wikipedia.org/wiki/Modulo_operation explicitly defines "modulo" as "remainder".