Calculator (2016)

Calculator is a simple command-line calculator. I have programmed the calculator to better understand how parsers work. The program is written in C and without any third-party libraries.

It can handle the following operations:

  • Pi Pi number
  • e Euler’s number
  • sqrt() Square root
  • cos() Cosine
  • sin() Sine
  • tan() Tangent
  • lg() Decimal logarithm
  • ln() Natural logarithm
  • () Brackets
  • || Absolute value
  • ! Factorial
  • Unary minus
  • ^ Exponent
  • % Modulus divide
  • *, / Multiply, Divide
  • +, - Add, Subtract

The source code and build instructions can be found on GitHub.