Skip to main content

Math: Clamp

Restrict a number to a [min, max] range. Bounds can be supplied either statically via the Min / Max parameters or dynamically via the same-named input connectors. The connector wins when both are set; either bound can be omitted to leave that side unbounded.

Example
Min: 0, Max: 10
Input: -3 → Output: 0
Input: 5 → Output: 5
Input: 20 → Output: 10

Parameters

Min

Static lower bound. Leave empty for no lower bound. Used when the min input connector is unwired.

Max

Static upper bound. Leave empty for no upper bound. Used when the max input connector is unwired.

Input

NumberREQUIRED
The value to clamp.
Min

Optional dynamic lower bound — overrides the Min parameter when wired.

Max

Optional dynamic upper bound — overrides the Max parameter when wired.

Output

Result
The clamped value.