I'm trying to cast an Integer
to Double
but Java is giving me wrong results, i believe due to overflow.
Integer ii = -123456789;
Double dd = ii.DoubleValue();
System.out.println(dd);
I am expecting to receive -123456789.0, but instead i am getting -1.23456789E8.
Is there a way to get rid of the decimals to gain a little range in the integer part? Or another data type with bigger range?
PS. Im converting code from another language that allows this with the same number of variable bytes.