rotate()
Catalog >
Rotates the bits in a binary integer. You can
enter Integer1 in any number base; it is
converted automatically to a signed, 64-bit
binary form. If the magnitude of Integer1 is
too large for this form, a symmetric modulo
operation brings it within the range. For
more information, see ►Base2, page 21.
To see the entire result, press £ and then
use ¡and¢ to move the cursor.
If #ofRotations is positive, the rotation is to
the left. If #ofRotations is negative, the
rotation is to the right. The default is −1
(rotate right one bit).
For example, in a right rotation:
In Hex base mode:
Each bit rotates right.
0b00000000000001111010110000110101
Rightmost bit rotates to leftmost.
produces:
0b10000000000000111101011000011010
The result is displayed according to the
Base mode.
Important: To enter a binary or
hexadecimalnumber, always use the 0b or
0hprefix (zero, not the letter O).
rotate(List1[,#ofRotations]) ⇒ list
Returns a copy of List1 rotated right or left
by #of Rotations elements. Does not alter
List1.
If #ofRotations is positive, the rotation is to
the left. If #of Rotations is negative, the
rotation is to the right. The default is −1
(rotate right one element).
In Dec base mode:
rotate(String1[,#ofRotations]) ⇒ string
Returns a copy of String1 rotated right or
left by #ofRotations characters. Does not
alter String1.
If #ofRotations is positive, the rotation is to
the left. If #ofRotations is negative, the
rotation is to the right. The default is −1
(rotate right one character).
Alphabetical Listing 151