TVecInt.BitShift Method

Overload List

#SignatureDescription
1function BitShift(const Src: TMtxVecInt; Bits: Integer): TMtxVecInt;Apply binary shift by number of Bits to the left (positive) or right (negative) to elements in Src.
└ indexed: function BitShift(const Src: TMtxVecInt; Bits: Integer; SrcIndex: Integer; Index: Integer; Len: Integer): TMtxVecInt;
2function BitShift(Bits: Integer): TMtxVecInt;Apply binary shift by number of Bits to the left (positive) or right (negative) for all elements in the calling object.
└ indexed: function BitShift(Bits: Integer; Index: Integer; Len: Integer): TMtxVecInt;

Overload 1: function BitShift(const Src: TMtxVecInt; Bits: Integer): TMtxVecInt;

Apply binary shift by number of Bits to the left (positive) or right (negative) to elements in Src.

#NameTypeDescription
1SrcTMtxVecIntsource TVecInt or TMtxInt
2BitsInteger

Result: stored in self (calling object), returns self for chaining

Returns: the result of binary shift to the left or right by number of Bits applied to Src values and stored in the calling object (Self). The sign of the numbers is preserved when doing right shift.

Indexed: function BitShift(const Src: TMtxVecInt; Bits: Integer; SrcIndex: Integer; Index: Integer; Len: Integer): TMtxVecInt;

Apply binary shift by number of Bits to the left (positive) or right (negative) to elements in Src.

#NameTypeDescription
1SrcTMtxVecIntsource TVecInt or TMtxInt
2BitsInteger
3SrcIndexIntegersource start index
4IndexIntegerstart index
5LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Returns: the result of binary shift to the left or right by number of Bits applied to Src values [SrcIndex]..[SrcIndex+Len-1] and stored in the calling object (Self) value [Index]..[Index+Len-1]. The sign of the numbers is preserved when doing right shift.

Overload 2: function BitShift(Bits: Integer): TMtxVecInt;

Apply binary shift by number of Bits to the left (positive) or right (negative) for all elements in the calling object.

#NameTypeDescription
1BitsInteger

Result: stored in self (calling object), returns self for chaining

Returns: the result of binary shift to the left or right by number of Bits applied to values in the calling object and stored back in the calling object. The shift preserves the sign of the numbers.

Indexed: function BitShift(Bits: Integer; Index: Integer; Len: Integer): TMtxVecInt;

Apply binary shift by number of Bits to the left (positive) or right (negative) to elements in the calling object.

#NameTypeDescription
1BitsInteger
2IndexIntegerstart index
3LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Returns: the result of binary shift to the left or right by number of Bits applied to values [Index]..[Index+Len-1] in the calling object and stored back in the calling object. The sign of the numbers is preserved when doing right shift.