Moomin Calculator - my prefix notation calculator written in C

A place to share and discuss technical news items, security breaches, new hardware/software etc.
Post Reply
User avatar
Manna5
Posts: 9
Joined: 2021-Aug-03, 7:54 am

Moomin Calculator - my prefix notation calculator written in C

Post by Manna5 »

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:

Code: Select all

+ 4 6
Difference of 7 and 2:

Code: Select all

- 7 2
Product of 8 and 5:

Code: Select all

* 8 5
Quotient of 64 and 16:

Code: Select all

/ 64 16
Exclusive or of true and false:

Code: Select all

^ t f
Generate Mersenne numbers:

Code: Select all

? > # 1 - * 2 # 1 2
Last edited by Manna5 on 2021-Aug-10, 8:34 am, edited 3 times in total.
User avatar
Simon Sheppard
Posts: 37
Joined: 2021-Jul-10, 7:46 pm
Has thanked: 4 times
Contact:

Re: Moomin Calculator - my prefix notation calculator written in C

Post by Simon Sheppard »

Interesting, is this command line based or a GUI?

A couple of examples would be helpful to see what it can do.
User avatar
Manna5
Posts: 9
Joined: 2021-Aug-03, 7:54 am

Re: Moomin Calculator - my prefix notation calculator written in C

Post by Manna5 »

I used command line to make it smaller and more portable. For example, + 5 - / 14 2 * 1 3 will return 9 (tomorrow I will add more examples).
User avatar
Manna5
Posts: 9
Joined: 2021-Aug-03, 7:54 am

Re: Moomin Calculator - my prefix notation calculator written in C

Post by Manna5 »

Latest news:
I launched a project website at http://manna5.c1.biz/moomin
User avatar
Simon Sheppard
Posts: 37
Joined: 2021-Jul-10, 7:46 pm
Has thanked: 4 times
Contact:

Re: Moomin Calculator - my prefix notation calculator written in C

Post by Simon Sheppard »

Suggestion: make the download button on your website much bigger, its too easy to miss buried in the footer text.
User avatar
Manna5
Posts: 9
Joined: 2021-Aug-03, 7:54 am

Re: Moomin Calculator - my prefix notation calculator written in C

Post by Manna5 »

These four links in the footer are the menu, and clicking Download tooks you to the download page with the download link immediately under the header.
Post Reply