Moomin Calculator - my prefix notation calculator written in C
Posted: 2021-Aug-09, 5:57 pm
I written a calculator in C called Moomin (after moomintrolls) that uses the prefix notation. It is like Scheme, but without brackets (and less functional). Main features:
- arithmetical operators (+, -, *, /)
- bitwise operators (~, &, |, ^)
- relational operators (<, >, =)
- conditional operator (?)
- recall operator (#)
- boolean constants (t = -1, f = 0)
A package containing the base version (source, executable, logotype and BNF schema) is available from: https://files.catbox.moe/r6bv9a.zip
Newer version that emits a bell character in case of invalid operator: https://files.catbox.moe/g1fzj3.zip
Sum of 4 and 6:
Difference of 7 and 2:
Product of 8 and 5:
Quotient of 64 and 16:
Exclusive or of true and false:
Generate Mersenne numbers:
- arithmetical operators (+, -, *, /)
- bitwise operators (~, &, |, ^)
- relational operators (<, >, =)
- conditional operator (?)
- recall operator (#)
- boolean constants (t = -1, f = 0)
A package containing the base version (source, executable, logotype and BNF schema) is available from: https://files.catbox.moe/r6bv9a.zip
Newer version that emits a bell character in case of invalid operator: https://files.catbox.moe/g1fzj3.zip
Sum of 4 and 6:
Code: Select all
+ 4 6
Code: Select all
- 7 2
Code: Select all
* 8 5
Code: Select all
/ 64 16
Code: Select all
^ t f
Code: Select all
? > # 1 - * 2 # 1 2