clip
relationalai.semantics.std.math
clip(value: NumberValue, lower: NumberValue, upper: NumberValue) -> ExpressionClip (clamp) a value to a range.
Parameters
Section titled “Parameters”
(valueNumberValue) - The value to clip.
(lowerNumberValue) - The lower bound.
(upperNumberValue) - The upper bound.
Returns
Section titled “Returns”Expression- AnExpressioncomputing the clipped value (min(upper, max(lower, value))). ReturnsNumberif the input isNumber, orFloatif the input isFloat.
Examples
Section titled “Examples”Clip values to a range:
>>> select(math.clip(Employee.score, 0, 100))>>> select(math.clip(Temperature.reading, -10, 40))