Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 879 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 879 Bytes

Bison-Flex-Calculator

CS Assignment - scientific calculator using Bison & Flex, with additonal functionality implemented in C

Functionality

  • Basic arithmetic following BODMAS rules e.g, 4 * (3 + 2) = 20
  • Standard functions (modulo, ceil, abs, floor)
  • Logarithmic functions (log2, log10)
  • Trig functions (cos, sin, tan)
  • Hyperbolic functions (cosh, sinh, tanh)
  • Conversions (currency, temperature, distance)
  • Variable stores (create and use your own variables. See example)
  • Can read input the command line or a file

Example

example screenshot

Requirements

  1. Bison (needs adding to PATH on windows)
  2. Flex (needs adding to PATH on windows)
  3. gcc compiler

Compile and execute

  1. bison -d gram.y
  2. flex lex.l
  3. gcc gram.tab.c lex.yy.c -lm -o scientific-calc
  4. scientific-calc