Skip to content

BC is an arbitrary precision arithmetic calculator written in C, inspired by the GNU bc. Supports basic arithmetic operations along with modulo, exponentiation, and shift operations.

License

Notifications You must be signed in to change notification settings

AdeshChoudhar/BC

Repository files navigation

BC

DSA-I mini project

BC is an arbitrary precision calculator written in C, inspired by the GNU bc.
Note: Currently, it is using a workaround for parsing. You can perform only one operation at a time.

Prerequisites

  • GCC-11
  • CMake (>=3.19)

Usage

For building the project for the first time.

mkdir <directory_name>
cd <directory_name>
cmake ..

Then for further builds, use make in the directory created in the previous step. Refer this demo, if required.

Operations supported

+ Addition % Modulo
- Subtraction ** Exponentiation
* Multiplication << Shift Left
/ Division >> Shift Right

Data structures

Digit Number
Digit Number
node_N stack_N
node_N stack_N
node_C stack_C
node_C stack_C
Pair token
Pair token

Future plans/updates

  • Convert given infix expression to postfix notation to ease the task of parsing and evaluating.
  • Optimising multiplication by implementing it using Karatsuba algorithm.
  • Rewrite the whole project in C++, to add some additional features which can take the help of the OOP concepts.
  • Use 'binary tree' data structure for expression evaluation.

Mentor

Asst. Prof. Shrida Kalamkar

References

About

BC is an arbitrary precision arithmetic calculator written in C, inspired by the GNU bc. Supports basic arithmetic operations along with modulo, exponentiation, and shift operations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published