MCPcopy
hub / github.com/KilledByAPixel/LittleJS / clamp

Function clamp

src/engineMath.js:117–117  ·  view source on GitHub ↗

Clamps the value between max and min * @param {number} value * @param {number} [min] * @param {number} [max] * @return {number} * @memberof Math

(value, min=0, max=1)

Source from the content-addressed store, hash-verified

115 * @return {number}
116 * @memberof Math */
117function clamp(value, min=0, max=1) { return value < min ? min : value > max ? max : value; }
118
119/** Returns what percentage the value is between valueA and valueB
120 * @param {number} value

Callers 15

math.test.mjsFile · 0.90
gamepadsUpdateFunction · 0.85
drawEllipseFunction · 0.85
glDrawPointsFunction · 0.85
glDrawColoredPointsFunction · 0.85
percentFunction · 0.85
lerpFunction · 0.85
lerpWrapFunction · 0.85
randInCircleFunction · 0.85
lerpMethod · 0.85
clampMethod · 0.85
lerpMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected