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

Method shr

projects/JavaScript/proto/int64.js:863–874  ·  view source on GitHub ↗

* This Int64 with bits shifted to the right 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

861 * @returns {!Int64} Shifted result value
862 */
863 shr (numBits) {
864 if (Int64.isInt64(numBits) || UInt64.isUInt64(numBits)) {
865 numBits = numBits.toInt32()
866 }
867 if ((numBits &= 63) === 0) {
868 return this
869 } else if (numBits < 32) {
870 return Int64.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits)
871 } else {
872 return Int64.fromBits(this.high >> (numBits - 32), (this.high >= 0) ? 0 : -1)
873 }
874 }
875
876 /**
877 * This Int64 with bits shifted to the right by the given amount with filling zeros to the left

Callers 2

divMethod · 0.95
sequentialMethod · 0.45

Calls 4

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

Tested by

no test coverage detected