Skip to content

A postfix calculator written in Rust. Supports variables and functions.

Notifications You must be signed in to change notification settings

Callum-Irving/postfix-calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postfix Calculator

What is postfix notation?

Postfix is just a different way of writing math. It is sometimes called "reverse polish notation". There is a good wikipedia article on it here.

Usage

The program can be run using cargo run.

Just pass a postfix expression and the result will be printed on the next line.

Example adding the numbers one and two:

$ cargo run
1 2 +
3

In infix (normal) notation, this looks like "1 + 2".

More complicated expression:

$ cargo run
1 2 + 3 + 6 *
36

In infix notation, this is "((1 + 2) + 3) * 6".

To close the program, you can type exit or just use Ctrl-C.

About

A postfix calculator written in Rust. Supports variables and functions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages