o_Bit Shift Left Truncating To Bits
Shift the given positive number to the left by the specified shift factor (number of bits), then truncate the representation to force bits above the specified position to be zeroed. The shift factor may be negative, indicating a right shift by the corresponding positive amount, in which case truncation will still happen.
For example, shifting the binary number 1011₂ to the left by 2 positions will produce 101100₂, then truncating it to, say 5 bits, would produce 01100₂. For a second example, the positive number 110101₂ can be shifted left by -2 positions (which is a right shift of 2) to get 1101₂, and a subsequent truncation to ten bits would leave it unaffected.
Return
⌊object × 2^shiftFactor⌋ mod 2^truncationBits
Parameters
The non-negative integer to shift and mask.
How much to shift left (may be negative to indicate a right shift).
A positive integer indicating how many low-order bits of the shifted value should be preserved.
Whether it is permitted to alter the original object if it happens to be mutable.