菜鸟提问,真奇怪,这是为什么????
public class test4_4
{
static float b = 10.98f;
public static void main(String args[])
{
int a=53;
float c=a+b;
System.out.println("="+c);
}
}
运行结果为:
=63.98
public class test4_4
{
static float b = 10.98f;
public static void main(String args[])
{
int a=54;
float c=a+b;
System.out.println("="+c);
}
}
运行结果为:
=64.979996
为什么只改了a 的值53->54而结果的精度却变了,为什么?