m3sh.linalg.
clamp#
- clamp(x, lo, hi)#
Clamp value to range.
Clamp x to the closed interval [lo, hi].
- Parameters:
- Returns:
- float
Clamped value.
Notes
To prevent data type changes arguments should not mix int and float values, i.e., use
>>> clamp(x, -1.0, 1.0)
if x is a floating point value, not
clamp(x, -1, 1).