* Returns x modulo y for Web IDL ConvertToInt step 10. * * This is intentionally not a general modulo helper. ConvertToInt only calls * it with a positive power-of-two modulus, and the implementation assumes * that. It converts JavaScript remainder into mathematical modulo and * normalizes -0 t
(x, y)
| 228 | * @returns {number} |
| 229 | */ |
| 230 | function modulo(x, y) { |
| 231 | // Web IDL ConvertToInt step 10 uses mathematical modulo. |
| 232 | const r = x % y; |
| 233 | if (r === 0) { |
| 234 | return 0; |
| 235 | } |
| 236 | return r > 0 ? r : r + y; |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * Returns x modulo y for Web IDL ConvertToInt step 10. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…