Skip to content

Handle large decimal and real numbers with ease.

Notifications You must be signed in to change notification settings

DuaA-A/BigRealApplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 &lt;&lt; "Sum: " &lt;&lt; sum &lt;&lt; std::endl;

BigReal real1("1234.5678");
BigReal real2("8765.4321");

BigReal difference = real1 - real2;
std::cout &lt;&lt; "Difference: " &lt;&lt; difference &lt;&lt; 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.

About

Handle large decimal and real numbers with ease.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published