Handle large decimal and real numbers with ease.
- Purpose: Handles large integer operations.
- Key Operations:
- Addition (
+
) - Subtraction (
-
) - Comparisons (
<
,>
,==
) - Assignment (
=
) - Size and sign determination
- Addition (
- Input Validation: Ensures valid numerical input.
- Integration: Outputs data with overloaded stream operators (
<<
).
- Purpose: Extends functionality to large floating-point numbers.
- Key Features:
- Handles integer and fractional parts separately.
- Arithmetic operations: Addition (
+
), Subtraction (-
). - Comparisons (
<
,>
,==
). - Assignment and move semantics.
- Constructors: Supports string, double, and
BigDecimalInt
. - Stream Operations: Input (
>>
) and Output (<<
).
#include "BigNumber.h"
#include "BigNumber.h" #include <iostream>int main() { BigDecimalInt num1("12345678901234567890"); BigDecimalInt num2("98765432109876543210");
BigDecimalInt sum = num1 + num2; std::cout << "Sum: " << sum << std::endl; BigReal real1("1234.5678"); BigReal real2("8765.4321"); BigReal difference = real1 - real2; std::cout << "Difference: " << difference << std::endl; return 0;
}
g++ -o BigNumberTest main.cpp BigNumber.h
- Windows
- macOS
- Linux
- Optimization for large-scale computations.
- Additional operations such as multiplication and division.
- Enhanced error handling and input parsing.
Contributions are welcome! Feel free to fork the repository and submit pull requests.
© 2025 BigNumber Library. All rights reserved.