Skip to content

Arbitrary length binary calculator (bc) - Linux Utility

License

Notifications You must be signed in to change notification settings

omkarsoak/DSA1-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arbitrary length binary calculator (bc) - Linux Utility

  • Arbitrary precision calculator that can add, subtract, multiply and divide arbitrary length numbers
  • Can compute arbitrary length expressions
  • numbers are stored in the form of linked list, with each digit forming a node
  • Direct infix evaluation (using stack) without converting to postfix
  • Example of calculation is $12038138198*120398019281-1232198319283+834729387242/32242$

Run Locally

gcc -Wall main.c linked_list.c stack.c operations.c -o main

INPUT: STRING OF NUMBERS AND '+ - * /' IN BETWEEN
OUPUT: ANSWER
EXAMPLE:
INPUT: $198237918479+83634875862-123312*242$
OUTPUT: $281842952837$


DATA STRUCTURES USED:

  • LINKED LIST (to store each number with each digit as a node in the LL)
  • NODE STACK (stores the numbers as pointer to head node of LL during infix evaluation)
  • char STACK (stores operators during infix evaluation)

Author

Omkar Oak - 112103099

About

Arbitrary length binary calculator (bc) - Linux Utility

Resources

License

Stars

Watchers

Forks

Languages