The ISHFT function performs the bit shift operation on bytes, integers and longwords.
Result = ISHFT(P1, P2)
If P2 is positive, P1 is left shifted P2 bit positions with 0 bits filling vacated positions. If P2 is negative, P1 is right shifted with 0 bits filling vacated positions.
The scalar or array to be shifted.
The scalar or array containing the number of bit positions and direction of the shift.
This routine is written to make use of IDL's thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the
Bit shift each element of the integer array [1, 2, 3, 4, 5] three bits to the left and store the result in B by entering:
B = ISHFT([1,2,3,4,5], 3)
The resulting array B is [8, 16, 24, 32, 40].
Introduced: Original