How java calculate remainder if left operand is smaller than left operand?
public class ModulusTest {
public static void main(String[] args) {
int a = 3 , b = 10;
int modul1 = b%a;
System.out.println("b modulus a = " + modul1);
int modul2 = a%b;
System.out.println("a modulus b = " + modul2);
}
}
Output:
b modulus a = 1
a modulus b = 3
Looks like it returns only left operand?