Reference constrain()

constrain()

Constrains a number between a minimum and maximum value.

Examples

Syntax

constrain(n, low, high)

Parameters

n
Number:

number to constrain.

low
Number:

minimum limit.

high
Number:

maximum limit.

Returns

Number: constrained number.
This page is generated from the comments in src/math/calculation.js . Please feel free to edit it and submit a pull request!

Related References