MCPcopy Create free account
hub / github.com/melonjs/melonJS / clamp

Function clamp

packages/melonjs/src/math/math.ts:108–110  ·  view source on GitHub ↗
(val: number, low: number, high: number)

Source from the content-addressed store, hash-verified

106 * @returns clamped value
107 */
108export function clamp(val: number, low: number, high: number) {
109 return val < low ? low : val > high ? high : val;
110}
111
112/**
113 * return a random integer between min (included) and max (excluded)

Callers 15

followMethod · 0.90
moveToMethod · 0.90
updateMethod · 0.90
playFunction · 0.90
updateMethod · 0.90
setOpacityMethod · 0.90
getImageDataMethod · 0.90
getFunction · 0.90
rMethod · 0.90
gMethod · 0.90
bMethod · 0.90
alphaMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected