-
Bug
-
Resolution: Fixed
-
P4
-
1.1.6
-
1.1.6
-
x86
-
windows_95, windows_nt
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2020657 | 1.2.0 | Deepa Viswanathan | P4 | Resolved | Fixed | 1.2beta4 |
Name: tb29552 Date: 05/16/98
Using the class below, execute it with the jit
and without. This is the result...
>java TestLargeNegLong
-1729256767
>java -nojit TestLargeNegLong
1
public class TestLargeNegLong {
public static void main(String[] arg) {
long l = 0xFFFFFFFFFFFFFFFFL;
long out = test(l);
System.out.println(out);
}
static long test(long s) {
long sRaised = s;
long n = 1799233297L;
long prod = 1;
for (int i = 0; i < 3; i++) {
if (i == 1 || i == 2)
prod = (prod * sRaised) % n;
sRaised = (sRaised * sRaised) % n;
}
readVal(prod);
return prod;
}
private static void readVal(long l) {
if (l < 0) l = -l;
}
}
(Review ID: 30014)
======================================================================
- backported by
-
JDK-2020657 different simple math results with and w/o JIT
- Resolved