Texas Instruments TI-89 Titanium User Manual page 216

Hide thumbs Also See for TI-89 Titanium:
Table of Contents

Advertisement

Creating a Multi-Statement Function
You can also create a user-defined function whose definition consists of multiple
statements. The definition can include many of the control and decision-making
structures (
,
If
ElseIf
For information about similarities and differences between functions and
Note:
programs, refer to Programming.
For example, suppose you want to create a function that sums a series of reciprocals
based on an entered integer (
1
1
+
+
+
-- -
----------- -
...
n
n 1
When creating the definition of a multi-statement function, it may be helpful to visualize it
first in a block form.
Ê
Func
Ë
Local temp,i
If fPart(nn)ƒ0 or nn{0
Ì
Return "bad argument"
0!temp
Í
For i,nn,1,M1
approx(temp+1/i)!temp
EndFor
Î
Return temp
Ê
EndFunc
Ê
Func and EndFunc must begin and end the function.
Ë
Variables not in the argument list must be declared as local.
Calculator Home Screen
,
, etc.) used in programming.
Return
):
n
1
-- -
1
213

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents