【发布时间】:2010-09-24 06:40:28
【问题描述】:
public class doublePrecision {
public static void main(String[] args) {
double total = 0;
total += 5.6;
total += 5.8;
System.out.println(total);
}
}
以上代码打印:
11.399999999999
我怎样才能让它只打印(或能够用作)11.4?
【问题讨论】:
标签: java floating-point double precision