0
What does " %" mean in Ruby please?
4 Answers
+ 7
3%2 is 1
2%3 is 2
+ 3
Isn't 2%3 == 2?
+ 2
it means module, the rest of the division.
(2%3==1)
//true
0
it is used for modulus. it returns the remainder
ex. 7â
2 = 1
since when we devide 7 by 2 it leaves 1 as remainder.