Jump to navigation Jump to search
Revision as of 14:35, 11 April 2019 by (Creates _SHR page)
The _SHR function is used to shift the bits of a numerical value to the right.
- result = _SHR(numericalVariable, numericalValue)
- numericalVariable is the variable to shift the bits of and can be of the following types: INTEGER, LONG, _INTEGER64, or _BYTE.
- Integer values can be signed or _UNSIGNED.
- numericalValue the number of places to shift the bits.
- While 0 is a valid value it will have no affect on the variable being shifted.
- Allows for division of a value by 2 faster than normal division (see example 2 below).
- Bits that reach the end of a variables bit count are dropped.
- The type of variable used to store the results should match the type of the variable being shifted.
128 1 0
128 64 32 16 8 4 2 1 0