public class doublePrecision {
public static void main(String[] args) {
double total = 0;
total += 5.6;
total += 5.8;
System.out.println(total);
}
}
Run Code Online (Sandbox Code Playgroud)
上面的代码打印:
11.399999999999
Run Code Online (Sandbox Code Playgroud)
我怎么才能打印(或能够用它)11.4?