Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.
/ expr_calc Public archive

A simple interpreter based calculator with operator precedence

License

Notifications You must be signed in to change notification settings

jarekt/expr_calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple expression calc

A simple calculator with operator precedence based on the same principles as a language interpreter (lexical analysis & parsing). Operator precedence is handled using the shunting yard algorithm.

General information

  • supported operators: ^ / * - +
  • limitations: results can't be bigger than the range of int in the c language -> values exceeding that are undefined

How to run

  • check the releases tab for executables (linux & windows supported)
  • or compile for yourself using cmake
    • some compilers that dont need libm may cause an error, to fix it just change the link_libm flag in CMakeLists.txt
    • visual studio has hard time compiling this (as it's written in c not c++) and therefore requires you to use the debug runtime library (hence the big windows executable size)
  • or run it online