stack
[]intstack holds the shared RPN operand stack, bottom (index 0) to top.
Value
<zero>
ErrUnderflow
*errors.errorStringErrUnderflow is raised when an operator needs more operands than available.
- OID
- 089375…61dc:5
ErrUnderflow details
ErrDivByZero
*errors.errorStringErrDivByZero is raised on division by zero.
- OID
- 089375…61dc:8
ErrDivByZero details
Push
func(token string)Push consumes a single token: an integer is pushed onto the stack; an operator (+, -, \*, /) pops two operands and pushes the result.
- OID
- 089375…61dc:10
Push details
Clear
func()Clear empties the shared stack.
- OID
- 089375…61dc:12
Clear details
Depth
func() intDepth returns the number of values currently on the stack.
- OID
- 089375…61dc:13
Depth details
Top
func() (int, bool)Top returns the top value and whether the stack is non-empty.
- OID
- 089375…61dc:14
Top details
Render
func(path string) stringRender renders the current stack, the top value as the result, and a short usage guide.
- OID
- 089375…61dc:15