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

Function mod

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

Returns first parm modulo the second param, but adjusted so negative numbers work as expected * @param {number} dividend * @param {number} [divisor] * @return {number} * @memberof Math

(dividend, divisor=1)

Source from the content-addressed store, hash-verified

107 * @return {number}
108 * @memberof Math */
109function mod(dividend, divisor=1) { return ((dividend % divisor) + divisor) % divisor; }
110
111/** Clamps the value between max and min
112 * @param {number} value

Callers 12

math.test.mjsFile · 0.90
handleTouchGamepadFunction · 0.85
touchGamepadRenderFunction · 0.85
setDirectionMethod · 0.85
modMethod · 0.85
setHSLAMethod · 0.85
fMethod · 0.85
getCurrentTimeMethod · 0.85
getPointMethod · 0.85
uiUpdateMethod · 0.85
gameRenderFunction · 0.85
gameRenderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected