aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-01-07 20:44:39 -0800
committerBruce Hill <bruce@bruce-hill.com>2019-01-07 20:44:39 -0800
commit3ceca7b635666342bed107bede4eafc1b5a5f482 (patch)
treea56569cf2cdb1693439dea5698b2045236479d4c
parent712b9bd68231e367f0c3c088f4837029537a80d0 (diff)
Added clamp function
-rw-r--r--core/math.nom5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/math.nom b/core/math.nom
index f7a0afb..088da12 100644
--- a/core/math.nom
+++ b/core/math.nom
@@ -137,6 +137,11 @@ test:
$best_key = $key
return $best
+externally ($ clamped between $min and $max) means:
+ if ($ < $min): return $min
+ if ($ > $max): return $max
+ return $
+
# Random functions
externally (seed random with $) means:
lua> ("