mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
fix typo 冗余的“使用”
This commit is contained in:
parent
69bdec3c50
commit
61773d3d37
@ -98,7 +98,7 @@ System.out.println(a);// 0.100000024
|
|||||||
System.out.println(b);// 0.099999964
|
System.out.println(b);// 0.099999964
|
||||||
System.out.println(a == b);// false
|
System.out.println(a == b);// false
|
||||||
```
|
```
|
||||||
具有基本数学知识的我们很清楚的知道输出并不是我们想要的结果(**精度丢失**),我们如何解决这个问题呢?一种很常用的方法是:**使用使用 BigDecimal 来定义浮点数的值,再进行浮点数的运算操作。**
|
具有基本数学知识的我们很清楚的知道输出并不是我们想要的结果(**精度丢失**),我们如何解决这个问题呢?一种很常用的方法是:**使用 BigDecimal 来定义浮点数的值,再进行浮点数的运算操作。**
|
||||||
|
|
||||||
```java
|
```java
|
||||||
BigDecimal a = new BigDecimal("1.0");
|
BigDecimal a = new BigDecimal("1.0");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user