Proper Modulo support


#1

I would like a Modulo operation implemented for primitive number types, where modulo is the mathematical modulo which always yields positive numbers. I couldn’t see it in the docs, and I find that it’s a very common operation which causes some people confusion in other languages as % is actually Rem as in Remainder, not Modulo. So I was thinking about proposing an RFC for modulo. It is able to be defined on all numeric types (signed, unsigned, float).


#2

Can you provide an example of the difference between Modulo and Remainder?

Ah I see its a positive negative thing. What do you want to propose, new syntax? or a function?