An open API service indexing awesome lists of open source software.

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.

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




  • 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, and BigDecimalInt.


  • 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.