BigInteger Class Reference

#include <big_integer.h>

Inheritance diagram for BigInteger:

Detailed Description

Reference counted class of BigIntegerInterface.

Public Member Functions

 MAXON_DEFAULT_REFERENCE_CONSTRUCTORS (BigInteger, Reference)
 
BigIntegeroperator+= (const BigInteger &b)
 
BigIntegeroperator-= (const BigInteger &b)
 
BigIntegeroperator++ ()
 
BigInteger operator++ (int)
 
BigIntegeroperator-- ()
 
BigInteger operator-- (int)
 
BigIntegeroperator*= (const BigInteger &b)
 
BigIntegeroperator/= (const BigInteger &b)
 
BigIntegeroperator%= (const BigInteger &b)
 
BigIntegeroperator<<= (Int s)
 
BigIntegeroperator>>= (Int s)
 

Friends

BigInteger operator+ (const BigInteger &a, const BigInteger &b)
 
BigInteger operator- (const BigInteger &a, const BigInteger &b)
 
BigInteger operator- (const BigInteger &b)
 
BigInteger operator* (const BigInteger &a, const BigInteger &b)
 
BigInteger operator/ (const BigInteger &a, const BigInteger &b)
 
BigInteger operator% (const BigInteger &a, const BigInteger &b)
 
BigInteger operator<< (const BigInteger &a, Int s)
 
BigInteger operator>> (const BigInteger &a, Int s)
 

Member Function Documentation

◆ MAXON_DEFAULT_REFERENCE_CONSTRUCTORS()

MAXON_DEFAULT_REFERENCE_CONSTRUCTORS ( BigInteger  ,
Reference   
)

◆ operator+=()

BigInteger& operator+= ( const BigInteger b)

Adds another integer to the first operand.

Parameters
[in]bThe second summand.
Returns
The result of this + b.

◆ operator-=()

BigInteger& operator-= ( const BigInteger b)

Subtracts a value from this BigIntegers.

Parameters
[in]bThe subtrahend.
Returns
The result of this - b.

◆ operator++() [1/2]

BigInteger& operator++ ( )

The prefix operator to increment this BigInteger.

Returns
The result of this + 1.

◆ operator++() [2/2]

BigInteger operator++ ( int  )

The postfix operator to increment this BigInteger.

Returns
The result of this + 1.

◆ operator--() [1/2]

BigInteger& operator-- ( )

The prefix operator to decrement this BigInteger.

Returns
The result of this - 1.

◆ operator--() [2/2]

BigInteger operator-- ( int  )

The postfix operator to decrement this BigInteger.

Returns
The result of this - 1.

◆ operator*=()

BigInteger& operator*= ( const BigInteger b)

Multiplies another integer to the first operand.

Parameters
[in]bThe second factor.
Returns
The result of this * b.

◆ operator/=()

BigInteger& operator/= ( const BigInteger b)

Divides this by another BigInteger.

Parameters
[in]bThe divisor. If the divisor is 0, the result will be 0.
Returns
The result of a / b.

◆ operator%=()

BigInteger& operator%= ( const BigInteger b)

Calculates the modulus of two BigInteger values.

Parameters
[in]bThe divisor. If the divisor is 0, the result will be 0.
Returns
The result of this % b.

◆ operator<<=()

BigInteger& operator<<= ( Int  s)

Shifts this BigInteger left by the specified number of bits.

Parameters
[in]sThe number of bits to left-shift the value. If this is negative, the value is shifted right.
Returns
The result of this << s.

◆ operator>>=()

BigInteger& operator>>= ( Int  s)

Shifts this BigInteger right by the specified number of bits.

Parameters
[in]sThe number of bits to right-shift the value. If this is negative, the value is shifted left.
Returns
The result of this >> s.

Friends And Related Function Documentation

◆ operator+

BigInteger operator+ ( const BigInteger a,
const BigInteger b 
)
friend

Adds two BigIntegers.

Parameters
[in]aThe fist summand.
[in]bThe second summand.
Returns
The result of a + b.

◆ operator- [1/2]

BigInteger operator- ( const BigInteger a,
const BigInteger b 
)
friend

Subtracts two BigIntegers.

Parameters
[in]aThe minuend.
[in]bThe subtrahend.
Returns
The result of a - b.

◆ operator- [2/2]

BigInteger operator- ( const BigInteger b)
friend

Subtracts two BigIntegers.

Parameters
[in]bThe subtrahend.
Returns
The result of this - b.

◆ operator*

BigInteger operator* ( const BigInteger a,
const BigInteger b 
)
friend

Multiplies two BigIntegers.

Parameters
[in]aThe fist factor.
[in]bThe second factor.
Returns
The result of a * b.

◆ operator/

BigInteger operator/ ( const BigInteger a,
const BigInteger b 
)
friend

Divides two BigIntegers.

Parameters
[in]aThe dividend.
[in]bThe divisor. If the divisor is 0, the result will be 0.
Returns
The result of a / b.

◆ operator%

BigInteger operator% ( const BigInteger a,
const BigInteger b 
)
friend

Calculates the modulus of two BigInteger values.

Parameters
[in]aThe dividend.
[in]bThe divisor. If the divisor is 0, the result will be 0.
Returns
The result of a % b.

◆ operator<<

BigInteger operator<< ( const BigInteger a,
Int  s 
)
friend

Shifts a BigInteger left by the specified number of bits.

Parameters
[in]aThe source operand.
[in]sThe number of bits to left-shift the value. If this is negative, the value is shifted right.
Returns
The result of a << s.

◆ operator>>

BigInteger operator>> ( const BigInteger a,
Int  s 
)
friend

Shifts a BigInteger right by the specified number of bits.

Parameters
[in]aThe source operand.
[in]sThe number of bits to right-shift the value. If this is negative, the value is shifted left.
Returns
The result of a >> s.