The ISHFT function performs the bit shift operation on bytes, integers and longwords.


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].


Result = ISHFT(P1, P2)

Return Value

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.


Thread Pool Keywords

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 !CPU system variable control whether IDL uses the thread pool for a given computation. In addition, you can use the thread pool keywords TPOOL_MAX_ELTS, TPOOL_MIN_ELTS, and TPOOL_NOTHREAD to override the defaults established by !CPU for a single invocation of this routine. See Chapter , “Thread Pool Keywords” for details.

Version History



See Also


This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However, it may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
© 2017 Exelis Visual Information Solutions, Inc., a subsidiary of Harris Corporation