Please check this below Java Code:
public class Test{
public static void main(String []args){
long start = 1572544800000L;
long end = 1635703200000L;
int d = 10;
int val = (int)(start + d + end + 0.0);
// value 2147483647
System.out.println("value: " + val);
}
}
Here if i change the value of d the output is always same 2147483647. which is Int max value.
And if i change 0.0 to 0 the output is as expected.
Anyone can explain this behavior in Java
Thanks