Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
391 B
1
Indexable
Never
s = "2. 5. SWAP -";
assertEquals ("expression: " + s, 3., DoubleStack.interpret (s), delta);
s = "3. DUP *";
assertEquals ("expression: " + s, 9., DoubleStack.interpret (s), delta);
s = "2. 5. 9. ROT - +";
assertEquals ("expression: " + s, 12., DoubleStack.interpret (s), delta);
s = "-3. -5. -7. ROT - SWAP DUP * +";
assertEquals ("expression: " + s, 21., DoubleStack.interpret (s), delta);