public class RPN
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
double |
execute(java.lang.String cmd) |
Executes the RPN string...
|
Variables |
getVariables() |
Return Variables class to be used by RPN Execution class
|
public RPN()
public RPN(Variables variables)
public double execute(java.lang.String cmd) throws MathException
cmd
- MathException
- Variables are any commands that start with a letter and that is not
one of the reserved keywords.
X is always the first on the stack.
Y is always second on the stack.
RPN uses a permissive stack. You can write or read any value to/from the
stack without error. If you have stacked three variables and try to access
the fourth variable you will get 0.0 and no error. Likewise if you try to
write to the fourth variable the value written will be lost. No errors
are returned from the stack.
Reserved keywords:public Variables getVariables()