discretize

xod/math/discretize

Rounds input `X` up to the first threshold `T0`, `T1`, ..., `Tš‘›` greater or equal to the `X`. If `X` is even greater than the last threshold, the value is round down to it.
discretize
@/discretize
Rounds input `X` up to the first threshold `T0`, `T1`, ..., `Tš‘›` greater or equal to the `X`. If `X` is even greater than the last threshold, the value is round down to it.
Xnumber
T0number
T1numberĀ (variadic)
discretize
X
T0
T1
ā€¦
T
Tnumber
The rounding result. Equals to one of Tx.

Tabular tests

XT0T1T
-100100
00100
50100
80100
1001010
2501010
-2510010
15201020
251000
Inf01010
-Inf0100
NaN010NaN