Appendix A: Functions and Instructions
783
0b
binaryNumber
0h
hexadecimalNumber
Without a prefix,
integer1
is treated as decimal. The
result is displayed in decimal, regardless of the
Base
mode.
Define
CATALOG
Define
funcName
(
arg1Name, arg2Name, ...
) =
expression
Creates
funcName
as a user-defined function. You
then can use
funcName
()
, just as you use built-in
functions
.
The function evaluates
expression
using
the supplied arguments and returns the result.
funcName
cannot be the name of a system variable
or built-in function.
The argument names are placeholders; you should
not use those same names as arguments when you
use the function.
Note:
This form of
Define
is equivalent to executing
the expression:
expression
!
funcName
(
arg1Name,arg2Name
)
.
This command also can be used to define simple
variables; for example,
Define a=3
.
Define g(x,y)=2x
ì
3y
¸
Done
g(1,2)
¸
ë
4
1
!
a:2
!
b:g(a,b)
¸
ë
4
Define h(x)=when(x<2,2x
-
3,
ë
2x+3)
¸
Done
h(
ë
3)
¸
ë
9
h(4)
¸
ë
5
Define eigenvl(a)=
cZeros(det(identity(dim(a)
[1])
-
x
ù
a),x)
¸
Done
eigenvl([
ë
1,2;4,3])
¸
{
2
ø
3
-
1
11
ë
(2
ø
3 + 1)
11
}
Define
funcName
(
arg1Name, arg2Name, ...
) = Func
block
EndFunc
Is identical to the previous form of
Define
, except
that in this form, the user-defined function
funcName
()
can execute a block of multiple
statements.
block
can be either a single statement or a series of
statements separated with the “:” character.
block
also can include expressions and instructions (such
as
If
,
Then
,
Else
, and
For
). This allows the function
funcName
()
to use the
Return
instruction to return a
specific result.
Note:
It is usually easier to author and edit this form
of Function in the program editor rather than on the
entry line.
Define g(x,y)=Func:If x>y Then
:Return x:Else:Return y:EndIf
:EndFunc
¸
Done
g(3,
ë
7)
¸
3
A binary number can have up to
32 digits. A hexadecimal number
can have up to 8.
Zero, not the letter O, followed by b or h.
Summary of Contents for Titanium TI-89
Page 9: ...Getting Started 6 TI 89 Titanium keys Ë Ì Í Ê ...
Page 34: ...Getting Started 31 2 or D 2 B u s i n e s s D B D B Press Result ...
Page 43: ...Getting Started 40 3 0 D B D D B D Press Result ...
Page 44: ...Getting Started 41 D 2 0 0 2 D B Scroll down to October and press Press Result ...
Page 58: ...Getting Started 55 Example Set split screen mode to TOP BOTTOM Press Result 3 B D ...
Page 70: ...Getting Started 67 ...
Page 175: ...Operating the Calculator 172 From the Keyboard ...
Page 456: ...Tables 453 ...
Page 527: ...Data Matrix Editor 524 ...