This repository contains a BigInteger library implemented in C++, which provides support for various arithmetic operations and functions for working with large integers.
The BigInteger library supports the following operations:
- Addition, Subtraction & Multiplication
- Exponentiation
- GCD
- Factorial
The input format for each type of operation is as follows:
-
Addition, Subtraction & Multiplication:
- First line:
1
- Second line: A single string representing the mathematical expression.
Example:
- First line:
1
32789123+99893271223x9203232392-4874223
- Exponentiation:
- First line:
2
- Second line: Two space-separated strings representing the base and exponent, respectively.
Example:
2
32789123 2
- GCD:
- First line:
3
- Second line: Two space-separated strings representing the numbers for which GCD is to be calculated.
Example:
3
32789123 99893271223
- Factorial:
- First line:
4
- Second line: A single string representing the number for which factorial is to be calculated.
Example:
4
32789123
The library assumes that the number of digits in the output won't exceed 3000 digits. Negative numbers are not present in the intermediate or final output, so there's no need to handle cases like subtraction resulting in negative values.
Contributions to the BigInteger library are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.