MCPcopy Index your code
hub / github.com/nodejs/node / bigIntModulo

Function bigIntModulo

lib/internal/webidl.js:250–254  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

248 * @returns {bigint}
249 */
250function 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).

Callers 1

convertToIntFunction · 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…