Skip to content

Documentation / base / clamp01

Function: clamp01()

clamp01(v): number

Defined in: libs/base/src/math/misc.ts:95

Clamps a number to the range [0, 1].

Parameters

v

number

The input value.

Returns

number

The value constrained to the range [0, 1].

Released under the MIT License.