In order to return the result of operations like 4/3 as an integer value, it rounds toward zero.
public class MainClass{
public static void main(String[] argv){
System.out.println(10 / 3);
System.out.println(-10 / 3);
System.out.println(10 / -3 );
System.out.println(11 / 3 );
System.out.println(-11 / 3);
System.out.println(11 / -3);
}
}
|