returns q^2, which is just n, as desired. But this needs one more substitution, q^2 = n, to complete the
simplification, and this does not work:
(ln(t^n)/(ln(t))|t=p^2 and n=q^2)|q^2=n
and in fact returns Memory error!
To avoid this problem, Bhuvanesh Bhatt offers the following program:
delay(xpr,constr)
Func
©delay(xpr,constr) evaluates xpr and then imposes constraint
©Copyright Bhuvanesh Bhatt
©December
1
999
if gettype(constr)
≠
"EXPR" and gettype(constr)
≠
"LIST":return "Error: argument"
if gettype(constr)="EXPR"
return xpr|constr
local i,tmp:
1→
i:while i
≤
dim(constr):constr[i]
→
tmp:xpr|tmp
→
xpr:i+
1→
i:endwhile:xpr
EndFunc
xpr is an expression to be evaluated, and may include constraints. constr may be either an expression
or a list. If constr is a list of constraints, then each constraint is evaluated in the while() loop. The call to
evaluate our example is
delay(ln(t^n)/ln(t)|t=p^2 and n=q^2,p^2=t and q^2=n)
which returns n.
Finally, note there is a simpler way to extract the exponent in this example, by using part():
part(t^n,2)
returns n. This works regardless of the complexity of t or n, for example,
part((a*t+2)^(3*sin(n),2)
returns 3*sin(n).
(credit to Bhuvanesh Bhatt)
[2.19] Restrict function arguments to integers
To restrict function arguments to the integer domain, you can use either int() or @nx with the "With"
operator "|". Consider
cos(2·Œ·n)
which is 1 for all integer n. However, the 89/92+ CAS returns the general result, since it cannot know
that n is an integer. One way to force the arguments to be integers is
cos(2·Œ·n)|n=int(x)
which returns 1. Another method is to use the arbitrary integer variable @nx, where x is an integer from
0 to 255. This method looks like this for x=0:
2 - 11
Содержание TI-92+
Страница 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Страница 53: ...LCD connector detail PCB switch side 1 42...
Страница 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Страница 55: ...Key cap detail 1 44...
Страница 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Страница 59: ...Keypad rubber sheet key cap side Inside front cover showing keycaps in place Detail of a key cap 1 48...
Страница 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...