Fix swapped out condition checks in nextDecimal
This commit is contained in:
parent
a3ed886900
commit
140bdab59c
@ -161,9 +161,9 @@ class RandomByteSource(private val source: RandomSource) {
|
|||||||
*/
|
*/
|
||||||
fun RandomSource.nextDecimal(bound: Decimal, round: Boolean = false): Decimal {
|
fun RandomSource.nextDecimal(bound: Decimal, round: Boolean = false): Decimal {
|
||||||
if (round)
|
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" }
|
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" }
|
require(bound.isFinite) { "Bound must be finite" }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user