clip
relationalai.semantics.std.math
clip(value: NumberValue, lower: NumberValue, upper: NumberValue) -> ExpressionClip (clamp) a value to a range.
Parameters
(valueNumberValue) - The value to clip.
(lowerNumberValue) - The lower bound.
(upperNumberValue) - The upper bound.
Returns
Expression- AnExpressioncomputing the clipped value (min(upper, max(lower, value))). ReturnsNumberif the input isNumber, orFloatif the input isFloat.-
Assumeslower <= upper; the result is unspecified for an inverted range.
Examples
Clip values to a range:
select(math.clip(Employee.score, 0, 100))select(math.clip(Temperature.reading, -10, 40))Referenced By
RelationalAI Documentation └── Release Notes └── Python API Release Notes └── What’s New in Version 1.18.0 └── Bug Fixes