MCPcopy Index your code
hub / github.com/plotly/plotly.js / modHalf

Function modHalf

src/lib/mod.js:16–20  ·  view source on GitHub ↗

* sanitized modulus function that always returns in the range [-d/2, d/2] * rather than (-d, 0] if v is negative

(v, d)

Source from the content-addressed store, hash-verified

14 * rather than (-d, 0] if v is negative
15 */
16function modHalf(v, d) {
17 return Math.abs(v) > (d / 2) ?
18 v - Math.round(v / d) * d :
19 v;
20}
21
22module.exports = {
23 mod: mod,

Callers 2

angleDeltaFunction · 0.85
coerce.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…