1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

将样例里的2.5->2.4 -2.5->-2.4

This commit is contained in:
一只咕咕鱼 2025-04-16 00:48:49 +08:00 committed by GitHub
parent ff77b0cabf
commit 9f164247f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,20 +99,20 @@ public BigDecimal divide(BigDecimal divisor, int scale, RoundingMode roundingMod
```java
public enum RoundingMode {
// 2.5 -> 3 , 1.6 -> 2
// -1.6 -> -2 , -2.5 -> -3
// 2.4 -> 3 , 1.6 -> 2
// -1.6 -> -2 , -2.4 -> -3
UP(BigDecimal.ROUND_UP),
// 2.5 -> 2 , 1.6 -> 1
// -1.6 -> -1 , -2.5 -> -2
// 2.4 -> 2 , 1.6 -> 1
// -1.6 -> -1 , -2.4 -> -2
DOWN(BigDecimal.ROUND_DOWN),
// 2.5 -> 3 , 1.6 -> 2
// -1.6 -> -1 , -2.5 -> -2
// 2.4 -> 3 , 1.6 -> 2
// -1.6 -> -1 , -2.4 -> -2
CEILING(BigDecimal.ROUND_CEILING),
// 2.5 -> 2 , 1.6 -> 1
// -1.6 -> -2 , -2.5 -> -3
FLOOR(BigDecimal.ROUND_FLOOR),
// 2.5 -> 3 , 1.6 -> 2
// -1.6 -> -2 , -2.5 -> -3
// 2.4 -> 2 , 1.6 -> 2
// -1.6 -> -2 , -2.4 -> -2
HALF_UP(BigDecimal.ROUND_HALF_UP),
//......
}