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

Method shr

projects/JavaScript/proto/int64.js:1755–1766  ·  view source on GitHub ↗

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

1753 * @returns {!UInt64} Shifted result value
1754 */
1755 shr (numBits) {
1756 if (Int64.isInt64(numBits) || UInt64.isUInt64(numBits)) {
1757 numBits = numBits.toInt32()
1758 }
1759 if ((numBits &= 63) === 0) {
1760 return this
1761 } else if (numBits < 32) {
1762 return UInt64.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits)
1763 } else {
1764 return UInt64.fromBits(this.high >> (numBits - 32), (this.high >= 0) ? 0 : -1)
1765 }
1766 }
1767
1768 /**
1769 * This UInt64 with bits shifted to the right by the given amount with filling zeros to the left

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