Texas Instruments TI-89 Manual Book page 516

Ti ti-89: user guide
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

shift()
CATALOG
shift(integer1[,#ofShifts])
Shifts the bits in a binary integer. You can
enter
integer1
converted automatically to a signed, 32-bit
binary form. If the magnitude of
too large for this form, a symmetric modulo
operation brings it within the range.
If
#ofShifts
#ofShifts
The default is ë 1 (shift right one bit).
In a right shift, the rightmost bit is dropped
and 0 or 1 is inserted to match the leftmost
bit. In a left shift, the leftmost bit is dropped
and 0 is inserted as the rightmost bit.
For example, in a right shift:
Each bit shifts right.
0b00000000000001111010110000110101
Inserts 0 if leftmost bit is 0,
or 1 if leftmost bit is 1.
produces:
0b00000000000000111101011000011010
The result is displayed according to the
mode. Leading zeros are not shown.
shift(list1 [,#ofShifts])
Returns a copy of
#ofShifts
If
#ofShifts
#ofShifts
The default is ë 1 (shift right one element).
Elements introduced at the beginning or end
of
by the shift are set to the symbol
list
"undef".
shift(string1 [,#ofShifts])
Returns a copy of
by
#ofShifts
If
#ofShifts
#ofShifts
The default is ë 1 (shift right one character).
Characters introduced at the beginning or
end of
string
integer
in any number base; it is
integer1
is positive, the shift is to the left. If
is negative, the shift is to the right.
list
shifted right or left by
list1
elements. Does not alter
is positive, the shift is to the left. If
is negative, the shift is to the right.
string
shifted right or left
string1
characters. Does not alter
is positive, the shift is to the left. If
is negative, the shift is to the right.
by the shift are set to a space.
In Bin base mode:
shift(0b1111010110000110101)
¸
is
shift(256,1) ¸
In Hex base mode:
shift(0h78E) ¸
shift(0h78E,ë 2) ¸
shift(0h78E,2) ¸
Important: To enter a binary or
hexadecimal number, always use the 0b
or 0h prefix (zero, not the letter O).
Dropped
Base
In Dec base mode:
shift({1,2,3,4}) ¸
.
list1
shift({1,2,3,4},ë 2) ¸
shift({1,2,3,4},1) ¸
shift("abcd") ¸
shift("abcd",ë 2) ¸
.
string1
shift("abcd",1) ¸
Appendix A: Functions and Instructions
0b111101011000011010
0b1000000000
0h3C7
0h1E3
0h1E38
{undef 1 2 3}
{undef undef 1 2}
{2 3 4 undef}
" abc"
"
ab"
"bcd "
499

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents