Clamp
Limits a number to a range.
Node id math/clamp
The Clamp node outputs value, unless it is outside the range from min
to max: then it outputs the nearest end. With the default range, 0 to 1,
1.4 gives 1 and -0.2 gives 0.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| value | number | 0 | |
| min | number | 0 | |
| max | number | 1 |
Outputs
| Name | Type | Notes |
|---|---|---|
| result | number |
Behaviour
- Range.
mindefaults to 0 andmaxto 1. - An inverted range (
mingreater thanmax) is not an error: the result is alwaysmax.