BigInteger Class Reference

Ported from More...

#include <BigInteger.h>

Inheritance diagram for BigInteger:
IComparable IMemoryValidate IHashable

List of all members.

Public Member Functions

 BigInteger (Array< byte > &bytes)
 BigInteger (Array< byte > &bytes, int offset, int length)
 BigInteger (int sign, Array< byte > &bytes, int offset, int length)
 BigInteger (int sign, Array< byte > &bytes)
 BigInteger (int sizeInBits, Random &random)
 BigInteger (int bitLength, int certainty, Random &random)
 BigInteger (const BigInteger &toCopy)
BigIntegeroperator= (const BigInteger &toAssign)
BigIntegeroperator= (const int64 i)
bool TestBit (int n) const
int GetBitLength () const
int GetLowestSetBit () const
BigIntegerPtr Abs () const
BigIntegerPtr Not () const
BigIntegerPtr And (const BigInteger &value) const
BigIntegerPtr Or (const BigInteger &value) const
BigIntegerPtr Xor (const BigInteger &value) const
BigIntegerPtr SetBit (int n) const
BigIntegerPtr ClearBit (int n) const
BigIntegerPtr FlipBit (int n) const
BigIntegerPtr Negate () const
BigIntegerPtr ShiftRight (int n) const
BigIntegerPtr ShiftLeft (int n) const
BigIntegerPtr Remainder (const BigInteger &n) const
BigIntegerPtr ModPow (const BigInteger &exponent, BigInteger &m)
BigIntegerPtr Mod (const BigInteger &m) const
BigIntegerPtr ModInverse (const BigInteger &m) const
BigIntegerPtr Multiply (const BigInteger &val) const
BigIntegerPtr Divide (const BigInteger &val) const
Array< BigIntegerPtrDivideAndRemainder (const BigInteger &val) const
BigIntegerPtr Add (const BigInteger &value) const
BigIntegerPtr Subtract (const BigInteger &n) const
BigIntegerPtr Gcd (const BigInteger &value) const
bool IsProbablePrime (int certainty) const
BigIntegeroperator+= (const BigInteger &bi)
BigIntegeroperator-= (const BigInteger &bi)
BigIntegeroperator*= (const BigInteger &bi)
BigIntegeroperator/= (const BigInteger &bi)
BigIntegeroperator<<= (int shiftVal)
BigIntegeroperator>>= (int shiftVal)
BigIntegeroperator%= (const BigInteger &bi)
BigIntegeroperator&= (const BigInteger &bi)
BigIntegeroperator|= (const BigInteger &bi)
BigIntegeroperator^= (const BigInteger &bi)
BigInteger operator<< (int shiftVal) const
BigInteger operator>> (int shiftVal) const
String ToString () const
Array< byte > ToByteArrayUnsigned () const
void ToByteArrayUnsigned (Array< byte > &a) const
Array< byte > ToByteArray () const
void ToByteArray (Array< byte > &a) const
int32 ToInt () const
int64 ToInt64 () const
uint32 ToUInt () const
virtual bool Equals (const IComparable *a) const
virtual int Compare (const IComparable *a) const
virtual bool Equals (const IComparable &a) const
virtual int Compare (const IComparable &a) const
bool Equals (int64 i) const
virtual int32 MajicNumber () const
 Class instances with the same majic number are of the same type (can be casted). Majic numbers above 0xFFFF are available for user applications.
virtual int32 HashCode () const
virtual void CheckMem () const
virtual void ValidateMem () const

Static Public Member Functions

static BigIntegerPtr ValueOf (int64 i)
static const BigIntegerZero ()
static BigIntegerPtr ZeroPtr ()
static const BigIntegerOne ()
static BigIntegerPtr OnePtr ()
static void CheckMemStatics ()
static void DebugClearStatics ()


BigInteger operator+ (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator- (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator* (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator/ (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator% (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator+ (const BigInteger &bi1, int64 i)
BigInteger operator- (const BigInteger &bi1, int64 i)
BigInteger operator* (const BigInteger &bi1, int64 i)
BigInteger operator/ (const BigInteger &bi1, int64 i)
BigInteger operator% (const BigInteger &bi1, int64 i)
BigInteger operator& (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator| (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator^ (const BigInteger &bi1, const BigInteger &bi2)
BigInteger operator- (const BigInteger &bi)
BigInteger operator~ (const BigInteger &bi)
BigInteger operator! (const BigInteger &bi)
bool operator== (const BigInteger &bi1, const BigInteger &bi2)
bool operator== (const BigInteger &bi1, int64 i)
bool operator!= (const BigInteger &bi1, const BigInteger &bi2)
bool operator!= (const BigInteger &bi1, int64 i)
bool operator> (const BigInteger &bi1, const BigInteger &bi2)
bool operator< (const BigInteger &bi1, const BigInteger &bi2)
bool operator>= (const BigInteger &bi1, const BigInteger &bi2)
bool operator<= (const BigInteger &bi1, const BigInteger &bi2)
bool operator&& (const BigInteger &bi1, const BigInteger &bi2)
bool operator|| (const BigInteger &bi1, const BigInteger &bi2)

Detailed Description

Ported from

Definition at line 42 of file BigInteger.h.

Member Function Documentation

bool BigInteger::IsProbablePrime ( int  certainty  )  const

return whether or not a BigInteger is probably prime with a probability of 1 - (1/2)**certainty.

From Knuth Vol 2, pg 395.

Definition at line 2361 of file BigInteger.cpp.

BigIntegerPtr BigInteger::OnePtr (  )  [static]

BUG: Not thread safe

Definition at line 713 of file BigInteger.cpp.

BigIntegerPtr BigInteger::ZeroPtr (  )  [static]

BUG: Not thread safe

Definition at line 744 of file BigInteger.cpp.

The documentation for this class was generated from the following files: