updated clamp function

Just made a quick update to use "and" in the clamp function instead of
x<y<z.
This commit is contained in:
Chris Mekelburg 2024-10-10 21:14:22 -04:00
parent 7a15d39c1c
commit d5ba653961
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ def clamp(value, low, high):
Returns value if it is between low and high. Returns value if it is between low and high.
If value is lower than low, returns low. If value is higher than high, returns high. If value is lower than low, returns low. If value is higher than high, returns high.
""" """
if low < value < high: #if low < value < high:
# return value
if low < value and value < high:
return value return value
if value < low: if value < low:
return low return low