* sanitized modulus function that always returns in the range [0, d) * rather than (-d, 0] if v is negative
(v, d)
| 5 | * rather than (-d, 0] if v is negative |
| 6 | */ |
| 7 | function mod(v, d) { |
| 8 | var out = v % d; |
| 9 | return out < 0 ? out + d : out; |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * sanitized modulus function that always returns in the range [-d/2, d/2] |
no outgoing calls
no test coverage detected