Functions
You are familiar with functions from mathematics. For example, if f is defined by f (x) = x + 1, then f (2) = 3 and f (7) = 8. You use functions in expressions. For example, if f (x) = x + 1, then expression f (3+2) + 1 has value 7. Evaluate an expression from the inside out.
and
|
Calling a function
An expression that uses a function is referred to as a function call. |
Nested function calls
The argument of a function can be any expression, including an expression that uses a function. For example, if f (x) = x + 1, then
and if g(x) = 2*x + 4, then
|
Arguments/parameters
If E is an expression and f is a function, then we say that E is the argument of f in expression f (E). I will use term parameter interchangeably with argument. |
Suppose that g(x) = 3x - 2. What is the value of expression g(g(9) + 1)? Answer