Arithmetic Evaluator/Go: Difference between revisions
m
Both examples work with Go 1. Library example needed a small tweak to match the API.
(Alternative solution using library functions) |
m (Both examples work with Go 1. Library example needed a small tweak to match the API.) |
||
Line 1:
__TOC__
=Operator precedence parser=
This is an operator precedence parser. The number format used in calculation can be changed with the line "type Number int".
Line 287 ⟶ 285:
func parseAndEval(exp string) (int, error) {
if err != nil {
return 0, err
|