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

Function pow2

lib/internal/webidl.js:206–217  ·  view source on GitHub ↗

* Returns 2 to the power of the given exponent. * @param {number} exponent Non-negative integer exponent. * @returns {number}

(exponent)

Source from the content-addressed store, hash-verified

204 * @returns {number}
205 */
206function pow2(exponent) {
207 if (exponent < 31) {
208 return 1 << exponent;
209 }
210 if (exponent === 31) {
211 return 0x8000_0000;
212 }
213 if (exponent === 32) {
214 return 0x1_0000_0000;
215 }
216 return MathPow(2, exponent);
217}
218
219/**
220 * Returns x modulo y for Web IDL ConvertToInt step 10.

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…