룰렛 합계 검증
- Float 값이라 정확히 100.0이 나오지 않으므로 totalPercentage가 99.9보다 크고 100.1보다 작으면 통과되도록 조건 수정
This commit is contained in:
parent
0e0114a7d1
commit
8700030707
|
@ -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%가 아닙니다")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue