mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Update java-basic-questions-01.md
printf 可以复现注释后的小数点数据
This commit is contained in:
parent
8adefc8b20
commit
aa8309167f
@ -665,7 +665,7 @@ private static long sum() {
|
||||
```java
|
||||
float a = 2.0f - 1.9f;
|
||||
float b = 1.8f - 1.7f;
|
||||
System.out.println(a);// 0.100000024
|
||||
System.out.printf("%.9f",a);// 0.100000024
|
||||
System.out.println(b);// 0.099999905
|
||||
System.out.println(a == b);// false
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user