Re:Python, unlike C, has the mod operator always return a po...
by thaumasiotes on Wednesday December 29, 2021 @06:51PM
(#29731664)
> 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].
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
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 explicitly defines "modulo" as "remainder".