Fix swapped out condition checks in nextDecimal

This commit is contained in:
DBotThePony 2025-03-26 22:21:02 +07:00
parent a3ed886900
commit 140bdab59c
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -161,9 +161,9 @@ class RandomByteSource(private val source: RandomSource) {
*/
fun RandomSource.nextDecimal(bound: Decimal, round: Boolean = false): Decimal {
if (round)
require(bound > Decimal.ZERO) { "Bound must be positive, $bound given" }
else
require(bound >= Decimal.ONE) { "Bound must be 1 or bigger, $bound given" }
else
require(bound > Decimal.ZERO) { "Bound must be positive, $bound given" }
require(bound.isFinite) { "Bound must be finite" }