seq(t[
1
and 0hF],k,0,
1
)
In this example, t is the list, and the Boolean and operator is used to calculate the index. k is the
sequence variable, and its limits are immaterial. Remember that Boolean operations on integers must
be executed in Exact or Auto mode; in Approx mode they will fail with a Data Type error.
The last example is the simplest possible command which demonstrates the error, but you would not
likely attempt this, anyway. A more realistic example which fails is
seq(t[(shift(n,k*
⁻
4) and 0hF)],k,0,7)
Again, the offending party is the Boolean and operator. Any of the Boolean operators (and, or, not, xor)
will cause the error. The index calculation itself does not cause the error, for example, this works:
0
→
k
t[(shift(n,k*
⁻
4) and 0hF)+
1
]
A Boolean operator will also cause an error if the summation function is used:
Σ
(t[(shift(n,
⁻
4*k) and 0hF)+
1
],k,0,7)
There may be other built-in functions which are also susceptible to this error.
In most cases you can work around this limitation. I found the limitation while attempting this command:
sum(seq(t[(shift(n,k*
⁻
4) and 0hF)+
1
],k,0,7))
→
s
The equivalent work-around is
0
→
s
for k,
1
,8
s+t[(n and 0hF)+
1
]
→
s
shift(n,
⁻
4)
→
n
endfor
The work-around is effective because the index calculation is not embedded in a seq() function call.
I emailed TI Cares about this, and they claim it will be fixed in the next AMS revision.
[3.26] Find indices of specific elements in lists and matrices
The built-in functions min() and max() return the minimum and maximum elements in lists and
matrices, but there are no built-in functions that find the indices at which these values occur. This tip
shows how to accomplish the more general task, of finding the locations of any target element, in TI
Basic and in C.
TI Basic version
Considering lists first, the general problem is to find the indices at which a particular element is located,
where that element is the minimum or maximum. This problem can be solved in a straight-forward way
by comparing each element to the target value, as shown in this function:
3 - 29
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...