Infix calculator
versione italiana
tCal is a simple scientific calculator for infix expressions developed mainly as C programming example
Uses Shunting-Yard algorithm to convert infix to postfix
Can be used inside shell scripts to manage expressions in a more readable format
It allows the use of numerical constants (pi, e) trigonometric, logarithmic and exponential operations
Accept expressions and nested parenthesis of arbitrary length
Can solve simple linear equations


  • expression must be quoted
  • to avoid bash-related problems with expression starting with minus use '--' before the argument. Ex:
    tcal -- "-1*3"
  • Compile with "make"
  • "test" folder contains some regression tests:
      #cd test
  • without args run in loop mode (interactive mode)


tCal v0.8


#tcal "(3+(4-1))*5"

#tcal "2 * x + 0.5 = 1"

#tcal "2x + 1 = 2(1-x)"

#tcal "sin(90)"

#tcal "ln(e)"

#tcal "asin(sin(1))"