+ 2
What is the difference between module operator (//) and normal division (/).
Both shows the quotient. Is it that one returns float and other integer.
2 ответов
+ 6
First one return integer (23//7=3) and second on return float (23/7=3.28...).have a nice day;-)
+ 3
Modulus operator returns the remainder of x%y while the divisor returns to result of dividing x/y.
Meaning that modulus is really neat to use for wrapping around numbers that make it useful for indentation and several other features in graphics programming.
Divison is simply a mathematical Division. Therefore modulus operator is used only when you require the remainder of dividing x by y (x/y).
E.g. 7%3 = 1 and 7/3 = 2.333...