IBitwise
Defined in: packages/math-numbers/src/num/ibitwise.ts:7
Bitwise operations available on types whose elements have a two’s-complement or unsigned binary representation.
Type Parameters
Section titled “Type Parameters”T extends IBitwise<T>
The carrier set.
Methods
Section titled “Methods”bitLength()
Section titled “bitLength()”bitLength():
number
Defined in: packages/math-numbers/src/num/ibitwise.ts:23
Number of bits required to represent the magnitude, excluding the sign.
Returns
Section titled “Returns”number
bitwiseAnd()
Section titled “bitwiseAnd()”bitwiseAnd(
other):T
Defined in: packages/math-numbers/src/num/ibitwise.ts:8
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”T
bitwiseNot()
Section titled “bitwiseNot()”bitwiseNot():
T
Defined in: packages/math-numbers/src/num/ibitwise.ts:11
Returns
Section titled “Returns”T
bitwiseOr()
Section titled “bitwiseOr()”bitwiseOr(
other):T
Defined in: packages/math-numbers/src/num/ibitwise.ts:9
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”T
bitwiseXor()
Section titled “bitwiseXor()”bitwiseXor(
other):T
Defined in: packages/math-numbers/src/num/ibitwise.ts:10
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”T
popCount()
Section titled “popCount()”popCount():
number
Defined in: packages/math-numbers/src/num/ibitwise.ts:26
Count of set bits in the magnitude.
Returns
Section titled “Returns”number
shiftLeft()
Section titled “shiftLeft()”shiftLeft(
count):T
Defined in: packages/math-numbers/src/num/ibitwise.ts:14
Logical/arithmetic left shift by count bit positions.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”T
shiftRight()
Section titled “shiftRight()”shiftRight(
count):T
Defined in: packages/math-numbers/src/num/ibitwise.ts:17
Arithmetic right shift, preserving the sign for signed types.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”T
unsignedShiftRight()
Section titled “unsignedShiftRight()”unsignedShiftRight(
count):T
Defined in: packages/math-numbers/src/num/ibitwise.ts:20
Logical right shift, filling with zero bits on the left.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”T