Defining functions that use lists – HP 49g+ User Manual
Page 264
Page 8-13
Defining functions that use lists
In Chapter 3 we introduced the use of the DEFINE function (
„à) to
create functions of real numbers with one or more arguments. A function
defined with DEF can also be used with list arguments, except that, any
function incorporating an addition must use the ADD operator rather than the
plus sign (
+). For example, if we define the function F(X,Y) = (X-5)*(Y-2),
shown here in ALG mode:
we can use lists (e.g., variables L1 and L2, defined earlier in this Chapter) to
evaluate the function, resulting in:
Since the function statement includes no additions, the application of the
function to list arguments is straightforward. However, if we define the
function G(X,Y) = (X+3)*Y, an attempt to evaluate this function with list
arguments (L1, L2) will fail:
To fix this problem we can edit the contents of variable
@@@G@@@ , which we can
list in the stack by using
…@@@G@@@,
to replace the plus sign (+) with ADD: