标签:大于等于 int new double 结果 nbsp 大于 等于 long
System.out.println(new Double(234314.999999999).longValue());//234314
System.out.println(new Double(234314.9999999999).longValue());//234314
System.out.println(new Double(234314.99999999999).longValue());//234315
System.out.println(new Double(234314.999999999999).longValue());//234315
System.out.println((long)234314.999999999);//234314
System.out.println((long)234314.9999999999);//234314
System.out.println((long)234314.99999999999);//234315
System.out.println((long)234314.999999999999);//234315
double转long时,小数位数不同,得到的结果可能不一样
正常时直接舍去小数位,小数位大于等于11位时可能会进位
标签:大于等于 int new double 结果 nbsp 大于 等于 long
原文地址:https://www.cnblogs.com/CoderRdf/p/12206921.html