clip

xod/math/clip

Clips an input value so that the value is always inside a [MIN, MAX] range.
clip
@/clip
Clips an input value so that the value is always inside a [MIN, MAX] range.
Xnumber
The input value
MINnumber
A lower bound of the range.
MAXnumber
An upper bound of the range.
clip
OUTOUTXXMINMINMAXMAX
OUTnumber
The result. Equals to `X` if it is already in the range, otherwise, its `Xc` rounded to a nearest bound: `MIN` or `MAX`.