Description
Constrains a number to be within a range.
Syntax
constrain(x, a, b)
Parameters
x
: the number to constrain Allowed data types: all data types.
a
: the lower end of the range. Allowed data types: all data types.
b
: the upper end of the range. Allowed data types: all data types.
Returns
x: if x is between a and b.
a: if x is less than a.
b: if x is greater than b.