Expressing functions: stack syntax – HP 48g Graphing Calculator User Manual
Page 135
Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".
Algebraic objects use algebraic syntax and thus use the normal rules
of algebraic precedence to determine the order in which the functions
are executed. Functions with higher precedence are performed hrst,
and functions with the same precedence are performed from left to
right. The HP 48’s functions have the following algebraic precedence,
from highest (1) to lowest (11):
1. Expressions within parentheses. Expressions within nested
parentheses are evaluated from inner to outer.
2. Prehx functions (such as SIN, INV, or LOG).
3. Postfix functions (such as !).
4. Power (■ ■ '■ ■ ).
5. Negation (-), multiplication (*), and division (.•■ ■ ').
6. Addition (+) and subtraction (-).
7. Comparison operators (---,
<, >, ii, or i±).
8. Logical operators AND aird NOT.
9. Logical operators OR and XOR.
10. The left argument for i (where).
11. Equals (=).
Example:
11
Cubes A, then adds B to that quantity, since
higher precedence than +.
has a
Raises A to the power 3+B, since an expression
within parentheses has a higher precedence than
Expressing Functions: Stack Syntax
Although there are very few postfix algebraic functions, all functions
on the HP 48 can be executed in postfix form using the stack. Stack
syntax is postfix syntax, where the arguments are entered first,
followed by the command or function name. Postfix syntax is often
a more efficient means of using a series of functions than is standard
algebriac syntax.
Thus the HP 48 allows you to use functions in two distinct ways:
algebraic syntax within algebraic objects or in postfix syntax executed
directly on the stack. For example, the sine function can be used
either as 'SIH
Using Mathematical Functions 11-3