548 Programming in HP PPL
BITSL Syntax: BITSL(int1 [,int2])
Bitwise Shift Left. Takes one or two integers as input and
returns the result of shifting the bits in the first integer to the
left by the number places indicated by the second integer.
If there is no second integer, the bits are shifted to the left
by one place.
Examples:
BITSL(28,2) returns 112
BITSL(5) returns 10.
BITSR Syntax: BITRL(int1 [,int2])
Bitwise Shift Right. Takes one or two integers as input and
returns the result of shifting the bits in the first integer to the
right by the number places indicated by the second
integer. If there is no second integer, the bits are shifted to
the right by one place.
Examples:
BITSR(112,2) returns 28
BITSR(10) returns 5.
BITXOR Syntax: BITXOR(int1, int2, … intn)
Returns the bitwise logical exclusive OR of the specified
integers.
Example: BITXOR(9,26) returns 19.
B→R Syntax: B→R(#integerm)
Converts an integer in base m to a decimal integer (base
10). The base marker m can be b (for binary), o (for
octal), or h (for hexadecimal).
Example: B→R(#1101b) returns 13
GETBASE Syntax: GETBASE(#integer[m])
Returns the base for the specified integer (in whatever is
the current default base): 0 = default, 1 = binary, 2 =
octal, 3 = hexadecimal.
Examples: GETBASE(#1101b) returns #1h (if the
default base is hexadecimal) while GETBASE (#1101)
returns #0h.