generated from mwc/lab_scatter
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:
parent
7a15d39c1c
commit
d5ba653961
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue