summaryrefslogtreecommitdiff
path: root/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/util/ext/Math.kt')
-rw-r--r--src/main/kotlin/io/dico/parcels2/util/ext/Math.kt1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt b/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
index f3b6d3b..a123bcf 100644
--- a/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
+++ b/src/main/kotlin/io/dico/parcels2/util/ext/Math.kt
@@ -33,6 +33,7 @@ fun IntRange.clamp(min: Int, max: Int): IntRange {
// the name coerceAtMost is bad
fun Int.clampMax(max: Int) = coerceAtMost(max)
+fun Double.clampMin(min: Double) = coerceAtLeast(min)
// Why does this not exist?
infix fun Int.ceilDiv(divisor: Int): Int {