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

Method shl

projects/JavaScript/proto/int64.js:844–855  ·  view source on GitHub ↗

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

(numBits)

Source from the content-addressed store, hash-verified

842 * @returns {!Int64} Shifted result value
843 */
844 shl (numBits) {
845 if (Int64.isInt64(numBits) || UInt64.isUInt64(numBits)) {
846 numBits = numBits.toInt32()
847 }
848 if ((numBits &= 63) === 0) {
849 return this
850 } else if (numBits < 32) {
851 return Int64.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)))
852 } else {
853 return Int64.fromBits(0, this.low << (numBits - 32))
854 }
855 }
856
857 /**
858 * This Int64 with bits shifted to the right by the given amount

Callers 3

divMethod · 0.45
test_int64.jsFile · 0.45
sequentialMethod · 0.45

Calls 4

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

Tested by

no test coverage detected