A C++ library for performing arbitrary-precision integer arithmetic, designed for use in Data Structures and Algorithms (DSA) projects or competitive programming environments.
- ✅ Arbitrary-size integers (
BigInteger) - ✅ Supports negative numbers
- ✅ Input expressions like
2 - 32,-100 + 200auto-parsed - ✅ Core arithmetic:
- ➕ Addition
- ➖ Subtraction
- ✖️ Multiplication
- ➗ Division
- 🧮 Modulus
- ✅ Comparisons:
<,>,==, etc. - ✅ Clean object-oriented design
- ✅ Easy to extend with exponentiation, factorial, etc.
BigIntegerOperations/
├── include/
│ └── BigInteger.h # Main header
├── src/
│ ├── BigInteger.cpp # Implementation
│ └── main.cpp # User input + demo
├── CMakeLists.txt # CMake support
├── Build.bat # Windows one-click build + run
├── tests/ # (optional future tests)
└── README.md
Enter first large integer or expression (a): 2 - 32
Enter second large integer or expression (b): 1000000000000000000000000 + 500
a + b = 999999999999999999999970
b - a = 1000000000000000000000532
a * b = -32000000000000000000000000
b / a = -31250000000000000000000
b % a = 0git clone https://github.com/yourname/BigIntegerOperations.git
cd BigIntegerOperations
mkdir build
cd build
cmake ..
cmake --build .Then run:
./mainDouble-click Build.bat or run:
Build.batInclude the header and link against the compiled .lib / .a or source:
#include "BigInteger.h"
BigInteger a("123456789123456789");
BigInteger b("-987654321987654321");
BigInteger sum = a + b;
std::cout << "Sum = " << sum << '\n';Tests will be added under tests/. Once available:
cd build
ctestPull requests are welcome! For major changes, open an issue to discuss them first.
- Clean, readable C++14+ code
- Avoid STL features that break determinism or increase complexity
- Add unit tests for new operations
This project is licensed under the MIT License — free to use, modify, and distribute.
Thanks to everyone exploring DSA and low-level arithmetic — you're building your own compiler-level logic! 🔢⚙️