+ 2

How does the ℅ sign work and calculate?

how does the ℅ sign calculate in Java. I am having trouble finding solution for this.

7th Jan 2017, 10:33 PM
Hans Kalders
Hans Kalders - avatar
3 Answers
+ 4
% is the modulo operator and it divides the first number by the second number and returns the rest: int x = 5%2; //x is 1 int y = 9%10; //y is 9 int z = 47%8; //z is 7
7th Jan 2017, 10:55 PM
FreakManMega
+ 1
Thanks freakman I now realise what I was doing wrong
7th Jan 2017, 10:59 PM
Hans Kalders
Hans Kalders - avatar
+ 1
yeah that's exactly what I was doing using the wrong symbol to calculate ℅ instead of %
7th Jan 2017, 11:15 PM
Hans Kalders
Hans Kalders - avatar