One key difference here is that, in Haskell (not in all lan-guages), if one or both arguments are negative, the results ofmodwill have the same sign as the divisor, while the result ofremwill have the same sign as the dividend
In other languages:
- Python and Ruby:
%is the modulus operator, same asmodin Haskell - JavaScript, Rust, Go:
%is a remainder operator, so same asrem