PDA

View Full Version : reverse polish notation



wegen
06-11-2006, 11:57
A suggestion to make things easier for students in particular-

Add a new let command that understands BODMAS operator precedence. Yes I know you need a 'stack' but the Programming Editor could be smart enough to use unused general variables or storage variables.

At the very least a BODMAS to RPN interconversion tool for the Programming Editor would be nice.

For example:
let w0 = (w1 + w2) / (w3 + w4)
would be converted to
'let w0 = (w1 + w2) / (w3 + w4)
let w5 = w3 + w4
let w0 = w1 + w2 / w5

or in the other direction
let w0 = w3*10 + w2 * 10 + w1
would be converted to
'let w0 = (10*w3 + w2) * 10 + w1

Cheers
Richard