When I assign from an int float, I thought that the float allows more precision, so it won’t lose or change the assigned value, but what I see is something completely different. What's going on here?
for(int i = 63000000; i < 63005515; i++) {
int a = i;
float f = 0;
f=a;
System.out.print(java.text.NumberFormat.getInstance().format(a) + " : " );
System.out.println(java.text.NumberFormat.getInstance().format(f));
}
output part:
...
63 005 504: 63 005 504
63 005 505: 63 005 504
63 005 506: 63 005 504
63 005 507: 63 005 508
63 005 508: 63 005 508
Thank!
source
share