룰렛 합계 검증

- Float 값이라 정확히 100.0이 나오지 않으므로 totalPercentage가 99.9보다 크고 100.1보다 작으면 통과되도록 조건 수정
This commit is contained in:
Klaus 2024-07-02 21:29:48 +09:00
parent 0e0114a7d1
commit 8700030707
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class RouletteService(
}
val totalPercentage = items.map { it.percentage }.sum()
if (totalPercentage > 100.1f || totalPercentage < 99.9f) {
if (totalPercentage > 100.1f || totalPercentage <= 99.99f) {
throw SodaException("확률이 100%가 아닙니다")
}
}