* 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. BigInt has no -0, but this mirrors modulo()'s mathematical modulo * behavior fo
(x, y)
| 248 | * @returns {bigint} |
| 249 | */ |
| 250 | function bigIntModulo(x, y) { |
| 251 | // Web IDL ConvertToInt step 10 uses mathematical modulo. |
| 252 | const r = x % y; |
| 253 | return r >= 0n ? r : r + y; |
| 254 | } |
| 255 | |
| 256 | /** |
| 257 | * Returns ToNumber(V). |
no outgoing calls
no test coverage detected
searching dependent graphs…