Skip to content

'bc' is an command line arbitrary precision calculator.Implementation of Unix based command 'bc' using C Programming language, as a part of DSA1 Project

Notifications You must be signed in to change notification settings

kartikmandhan/bc-Infinite-Precison-Calculator

Repository files navigation

Project Name:- Binary Calculator (Infinite Precision Calculator)

DESCRIPTION :-

  • This is the Command line Arbitrary precision calculator which is implemented using C Programming language.
  • It tries to implement some functionalities from unix based command 'bc'.

  • Operations performed on countably infinite length numbers are as follows:-
    • Addition
    • Substraction
    • Multiplication
    • Division
    • Modulus
    • SquareRoot
    • Trignometric Functions like Sine, Cosine, Tangent, input angle is considered in radian units
    • Length of the Number
    • exponential i.e e(x)
    • Factorial of a Number (try 3 digit numbers only) . Try 1000! on Google calculator it says infinite :)

  • All expressions are evaluated according to their precedence.
  • paranthesis '()' can be used which is having higher precedence.
  • All the operations performed are stored in history.txt file, for future reference

Execution Instruction :-

  • Clone the repository on your machine.
  • Open Terminal and change directory to the project directory.
  • Type command ' make ' which will compile the required files and generate executable file. (Linux/Mac recommended)
  • Then type the command ' ./project '.
  • Run ./project -h to get a list of all operations that it can perform
  • ./project <filename> will take input from the file and output it on the terminal, example: ./project test.txt
  • An enter key on empty line exits the program

DataStructures used :-

A Doubly Linked List of struct node with Head and tail pointer

For tokenizing the Input String, I had used Finite State Machine

Screenshots of the working Application :-

Pull Requests are Welcomed, Giving A Star is appreciated

About

'bc' is an command line arbitrary precision calculator.Implementation of Unix based command 'bc' using C Programming language, as a part of DSA1 Project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published