Giter Club home page Giter Club logo

bigreal's Introduction

BigReal Class

Table of Contents

Introduction

The BigReal class is designed to represent real numbers with both integer and fractional components. It can handle large numbers that exceed the limitations of standard C++ data types by utilizing the BigDecimalInt class for managing integer digits.

Class Overview

The class has the following private members:

  • BigDecimalInt integerDigits: Represents the integer part of the real number.
  • BigDecimalInt fractionDigits: Represents the fractional part of the real number.
  • char Sign: Represents the sign of the real number ('+', '-' ).

It also provides various member functions for performing arithmetic operations, handling carries and borrows, and managing the format of fractions.

Constructor

The BigReal class provides several constructors:

  • BigReal(double = 0.0): Default constructor.
  • BigReal(string): Constructor to initialize from a string.
  • BigReal(BigDecimalInt): Constructor to initialize from a BigDecimalInt object.
  • BigReal(BigDecimalInt, BigDecimalInt, char): Constructor to initialize all components explicitly.

Assignment Operators

The class supports assignment from various types, including string, BigDecimalInt, int, and long long.

Arithmetic Operators

The class supports addition and subtraction operations for BigReal objects.

Relational Operators

Relational operators such as <, >, and == are implemented to compare BigReal objects.

IO Operators

Input and output stream operators (<< and >>) are overloaded to facilitate easy input and output of BigReal objects.

Getter Methods

The class provides methods to retrieve the size and sign of the BigReal object.

Example Usage

Here is an example of how to use the BigReal class:

#include "BigReal.h"
#include <iostream>
// Your code goes here

Authors

bigreal's People

Contributors

minaalbertsaeed avatar

Stargazers

Ahmed Zaher avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.