-
-
Save KD4/b98be3cc9b356ba9b368bb63ff2e5dc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun roundTest() { | |
val num = 27.0 / 6 | |
round(num) // 뱅커스 라운딩 = 4 | |
BigDecimal.valueOf(num).setScale(0, RoundingMode.HALF_EVEN) // 뱅커스 라운딩 = 4 | |
num.roundToInt() // 산술적 라운딩 = 5 | |
BigDecimal.valueOf(num).setScale(0, RoundingMode.HALF_UP) // 산술적 라운딩 = 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment