I was wondering how does Java handle the intermediate values while evaluating a mathematical expression specially when the intermediate values exceeds their storage size. For an example,
int a = 1103515245;
int x = 1013904223;
int c = 2531011;
x = (a*x + c) & 0x7FFFFFFF; // to make sure x will remain a positive integer.
Now, my question is while computing a*x
, its value exceeds integer range (even during the addition it could happen), how this is taken care by Java Compiler?
Thank you.