Skip to content

mivinci/calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

🧮 A minimal implementation for an integer calculator in pure C. It uses reverse polish expression to do the calculating as follows: 1*(2+3) => 1 2 3+* => 5

Install:

git clone git@github.com:Mivinci/calculator.git
cd calculator
make
make install

Usage:

To calculate 1*(2+3), just run:

calc 1*(2+3)

Or you might want to view the reverse polish expression:

calc 1*(2+3) -c

Or just run calc to enter input mode:

calc
>> 1*(2+3)
5

Todos

  • Support both float numbers and negative numbers.
  • Extract from file.
  • Should I use a tokenizer and a parser?

About

🧮 A minimal implementation for an integer calculator in pure C.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published