参考 constrain()

constrain()

将一个数字限制在最小值和最大值之间。

示例

语法

constrain(n, low, high)

参数

n
数字:

需要限制的数字。

low
数字:

最小限制。

high
数字:

最大限制。

返回值

数字: 受限制的数字。
This page is generated from the comments in src/math/calculation.js . Please feel free to edit it and submit a pull request!

相关参考