GEORGE (programming language): Difference between revisions

Content deleted Content added
Reverted 1 edit by JoaquinFerrero (talk): Rv. (TW)
Replaced the wrong 'b' by 'x' in the first sentence description of the evaluation of y = ax^2+bx+c.
Line 11:
Following the reverse Polish form, an assignment statement to evaluate the formula <math>y = ax^2 + bx + c</math> was written as <code>a x dup × × b x × + c + (y)</code>.
 
The computer evaluated the expression as follows: the values of <code>a</code>, then <code>bx</code>, were pushed onto the top of the [[stack machine|accumulator stack]]; '<code>dup</code>' caused a copy of the top-most value (<code>x</code>) to be pushed onto the top of the accumulator stack; Multiply (<code>×</code>) caused the top two values, namely, <code>x</code> and <code>x</code>, to be removed (popped) and multiplied, returning the product to the top of the accumulator stack. The second multiply (<code>×</code>) then caused the top two values on the stack (namely, <code>a</code> and <code>x**2</code>) to be popped and multiplied, and the product (<code>a×x**2</code>) to be pushed onto the top of the accumulator stack. And so on the remaining components of the expression. The final operation, namely (<code>y</code>), returned the value of the expression to storage without changing the status of the accumulator stack.
 
Assuming that the value on the top of the accumulator stack was not required immediately, it would be removed (cleared) by using the operator (<code>;</code>).