Skip to content

A simple scientific calculator for the command line.

License

Notifications You must be signed in to change notification settings

Sqvid/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

A simple command line scientific calculator implemented in C. Utilises the shunting yard algorithm to process infix expressions.

Features:

  • Generic stack implementation.
  • Infix expression strings.
  • Early evaluation.
  • Precedence-aware calculation.
  • Single-argument functions.
  • Actually descriptive error messages.
  • Mathematical constants and previous answer memory.

Functions:

  • sqrt(...) square root.
  • sin(...) sine.
  • cos(...) cosine.
  • tan(...) tangent.
  • More soon.TM

Constants:

  • pi Pi.
  • e Euler's number.
  • ans Previous answer.