beautypg.com

Creating your own functions – HP Prime Graphing Calculator User Manual

Page 429

background image

Functions and commands

425

Inserts a less-than-or-equal-to sign.

Inserts a greater-than-or-equal-to sign.

Evaluates the expression then stores the result in variable var.
Note that

cannot be used with the graphics G0–G9. See the

command BLIT.

expression

var

i

Inserts the imaginary number i.

-1

Returns the inverse of an expression.

(Expr)

–1

Creating your own functions

You can create your own function by writing a program (see

chapter 27) or by using the simpler DEFINE functionality.

Functions you create yourself appear on the User menu (one

of the Toolbox menus).

Suppose you wanted to create the function

SINCOS(A,B)=SIN(A)+COS(B)+C.

1. Press

Sd

(Define).

2. In the Name field, enter

a name for the

function—for example,

SINCOS—and tap

.

3. In the Function field,

enter the function.

eA

A

>+fA

B

>A

C

New fields appear

below your function, one

for each potential

parameter it. will take.

You need to decide

which ones are to be

parameters when the

function is called. In this

example, we’ll make A

and B parameters. The value of C will be provided by

global variable C (which by default is zero).