For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/functions/clampNumber.md.

Function: clampNumber()

clampNumber(val, min, max): number

Clamps the passed in number to the passed in min and max values.

将输入的数值钳制在给定的最小值和最大值之间。

Parameters

val

number

min

number

max

number

Returns

number