We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb519a2 commit 3d0a549Copy full SHA for 3d0a549
common/src/main/kotlin/com/lambda/util/math/MathUtils.kt
@@ -59,6 +59,7 @@ object MathUtils {
59
private fun decimalPlaces(value: Double) = BigDecimal.valueOf(value).scale()
60
61
fun random(v1: Double, v2: Double): Double {
62
+ if (v1 == v2) return v1
63
val min = min(v1, v2)
64
val max = max(v1, v2)
65
return nextDouble(min, max)
0 commit comments