Jump to content

Arithmetic evaluation: Difference between revisions

J: expand on opening comment
(+ast note)
(J: expand on opening comment)
Line 1,053:
=={{header|J}}==
 
Note that once you get beyond a few basic arithmetic operations, what we commonly call "mathematical precedence" stops making sense, and its primary value is that it allows polynomials to be expressed simply. (but Neverthlessexpressing polynomials as a sequence of coefficients, thisone taskfor dealseach onlyexponent, withis simpleeven arithmeticsimpler).
 
Neverthless, this task deals only with simple arithmetic.
 
The implementation here uses a shift/reduce parser to build a tree structure which J happens to support for evaluation:
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.