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

Method shru

projects/JavaScript/proto/int64.js:882–900  ·  view source on GitHub ↗

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

(numBits)

Source from the content-addressed store, hash-verified

880 * @returns {!Int64} Shifted result value
881 */
882 shru (numBits) {
883 if (Int64.isInt64(numBits) || UInt64.isUInt64(numBits)) {
884 numBits = numBits.toInt32()
885 }
886 numBits &= 63
887 if (numBits === 0) {
888 return this
889 } else {
890 let high = this.high
891 if (numBits < 32) {
892 let low = this.low
893 return Int64.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits)
894 } else if (numBits === 32) {
895 return Int64.fromBits(high, 0)
896 } else {
897 return Int64.fromBits(high >>> (numBits - 32), 0)
898 }
899 }
900 }
901}
902
903Object.defineProperty(Int64.prototype, '__isInt64__', { value: true })

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