Additional Graphing Topics 478
For example, consider the previous three-piece function.
Note: For information about similarities and differences between functions and
programs, refer to Programming.
A multi-statement, user-defined function can have many of the control and decision-
making structures (
If, ElseIf, Return, etc.) used in programming. When creating the
structure of a function, it may be helpful to visualize it first in a block form.
Ê
Func and EndFunc must begin and end the function.
When entering a multi-statement function on the Y= Editor or Home screen, you must
enter the entire function on a single line.
When: Use expression:
x < Mp
4 sin(x)
x
| M p and x < 0
2x + 6
x | 0
6 – x
2
Ê
Ê
Func
If x< M p Then
Return 4ùsin(x)
ElseIf x>=-p and x<0 Then
Return 2x+6
Else
Return 6–x^2
EndIf
EndFunc