0
What is the purpose of the porcent symbol(%); modulus operator in the ruby programming?
x=5 y=2 puts x%2 #outputs 1
2 Answers
+ 2
One example is to convert total seconds to "hour:minute" format. To get the "second" part you need totalSecond%60
0
the purpose is remainder value store by the division.