/odin-calculator

simple calculator in a terminal

Primary LanguageOdin

odin-calculator

./odin-calc
>>> 1 + 2 * 2 + -(3 + 2) * 2
  = -5.000000

>>> exit

Why?

for fun 👍

Supported features

  • ascii input
  • operator precedence
  • unary plus and minus (currently it is part of a number, not an operator)
  • predefined constatns (pi, tau, e)
  • nested parentheses (implemented via recursion, so it may stack overflow)

Planed features

  • unicode input
  • nice error message
  • non-interactive mode
  • user defined variables
  • predefined functions
  • user defined functions
  • user defined operators
  • simple line edit capabilities (similar to linenoise)
  • more cool ideas...