Name: swC45995 Date: 10/07/96
In Windows integer remainder operation completes abruptly in the case when
the negative value of the largest magnitude is the dividend and -1 is the
divisor. Thus, execution of the following test:
public class test
{
public static void main(String argv[])
{
int i = 0x80000000;
System.out.println(i % -1);
}
}
produces the following output:
exception of rounding to zero:
instead of expected:
0
======================================================================
- duplicates
-
JDK-4007660 integer division overflow throws an exception in Windows
- Closed
- relates to
-
JDK-1264851 Division of int x80000000 by -1 X86 Solaris
- Closed