All our mathematics books have been teaching us that a remainder is always positive. Wiki tells me that a remainder can be a least positive remainder or a least absolute remainder. It is a pretty basic concept which can be very difficult to unlearn for a lot people(including me). It could be cause of weird bugs when a programmer is working with multiple languages.
What is the reason behind erlang redefining such a basic concept?
Eshell V6.2 (abort with ^G)
1> -5 rem 3.
-2
This result is not consistent with either of Least Positive Remainder or Least Absolute Remainder Concept.