Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 867 Bytes

README.md

File metadata and controls

44 lines (34 loc) · 867 Bytes

Reverse Polish notation (RPN)

Reverse Polish notation (RPN) is a mathematical notation in which every operator follows all of its operands, in contrast to Polish notation (PN), which puts the operator before its operands. It is also known as postfix notation. It does not need any parentheses as long as each operator has a fixed number of operands. The description "Polish" refers to the nationality of logician Jan Łukasiewicz, who invented (prefix) Polish notation in the 1920s.

(Wiki 26.02.2017 -> https://en.wikipedia.org/wiki/Reverse_Polish_notation)

Example code

10 x =
0 a =
1 b =

start :

1 x - x =
a temp =
b a =
temp b + b =

a PRINTLN

start x JNZ

Finished_The_Task! PRINTLN
Result:__ PRINT
a PRINTLN

This code example will calculate the 10th fibonacci number. Output:

1
1
2
3
5
8
13
21
34
55
Finished_The_Task!
Result:__55