* sanitized modulus function that always returns in the range [-d/2, d/2] * rather than (-d, 0] if v is negative
(v, d)
| 14 | * rather than (-d, 0] if v is negative |
| 15 | */ |
| 16 | function modHalf(v, d) { |
| 17 | return Math.abs(v) > (d / 2) ? |
| 18 | v - Math.round(v / d) * d : |
| 19 | v; |
| 20 | } |
| 21 | |
| 22 | module.exports = { |
| 23 | mod: mod, |
no outgoing calls
no test coverage detected
searching dependent graphs…