Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or in forth, which uses reverse polish notation:

  30 2 power 2 +
(a constant gets pushed onto the stack. functions like "power" and "+" operate on the stack)

So this also works:

  2 30 2 power +
Although I don't really use it anymore, my calculator (an HP scientific calculator) also uses reverse polish notation, so you can keep intermediate values on the stack, and do complex calculations without using parentheses at all. This is also good for keeping people from asking to borrow your calculator in math class. :)

What is the syntax that you posted? It looks just like RPN in reverse. Ok, that was a stupid question. I just figured out that is just "polish notation." It must keep a stack of operations that don't have their operands yet.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: