MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / shl

Method shl

projects/JavaScript/proto/int64.js:1736–1747  ·  view source on GitHub ↗

* This UInt64 with bits shifted to the left by the given amount * @this {!UInt64} * @param {Int64|UInt64|number} numBits Number of bits * @returns {!UInt64} Shifted result value

(numBits)

Source from the content-addressed store, hash-verified

1734 * @returns {!UInt64} Shifted result value
1735 */
1736 shl (numBits) {
1737 if (Int64.isInt64(numBits) || UInt64.isUInt64(numBits)) {
1738 numBits = numBits.toInt32()
1739 }
1740 if ((numBits &= 63) === 0) {
1741 return this
1742 } else if (numBits < 32) {
1743 return UInt64.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)))
1744 } else {
1745 return UInt64.fromBits(0, this.low << (numBits - 32))
1746 }
1747 }
1748
1749 /**
1750 * This UInt64 with bits shifted to the right by the given amount

Callers

nothing calls this directly

Calls 4

isInt64Method · 0.80
isUInt64Method · 0.80
toInt32Method · 0.45
fromBitsMethod · 0.45

Tested by

no test coverage detected