Loading

evm_clamp

Scalar function

Constrains x to the range [lo, hi]. Returns lo if x < lo, hi if x > hi, otherwise x. Equivalent to max(lo, min(hi, x)).

evm_clamp(UINT256, UINT256, UINT256)

Parameters

Returns

Name Type
result UINT256
1
SELECT evm_clamp(spot_price, min_price, max_price) AS bounded_price;
Notebook ready in readonly mode.