https://github.com/duaa-a/bigrealapplication
Handle large decimal and real numbers with ease.
https://github.com/duaa-a/bigrealapplication
bignumbers cpp
Last synced: over 1 year ago
JSON representation
Handle large decimal and real numbers with ease.
- Host: GitHub
- URL: https://github.com/duaa-a/bigrealapplication
- Owner: DuaA-A
- Created: 2024-04-23T16:40:10.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-05T21:53:32.000Z (over 1 year ago)
- Last Synced: 2025-01-22T13:52:48.885Z (over 1 year ago)
- Topics: bignumbers, cpp
- Language: C++
- Homepage: https://github.com/DuaA-A
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Big Real Application
Handle large decimal and real numbers with ease.
Features
BigDecimalInt Class
-
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 (<<).
BigReal Class
-
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, andBigDecimalInt. -
Stream Operations: Input (>>) and Output (<<).
Usage
Include the Library
#include "BigNumber.h"
Example Code
#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;
}
Compilation
g++ -o BigNumberTest main.cpp BigNumber.h
Supported Platforms
- Windows
- macOS
- Linux
Future Work
- Optimization for large-scale computations.
- Additional operations such as multiplication and division.
- Enhanced error handling and input parsing.
Contributions
Contributions are welcome! Feel free to fork the repository and submit pull requests.
© 2025 BigNumber Library. All rights reserved.