Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
internal::BigInteger Class Reference

#include <biginteger.h>

Public Types

typedef uint64_t Type
 

Public Member Functions

 BigInteger (const BigInteger &rhs)
 
 BigInteger (uint64_t u)
 
 BigInteger (const char *decimals, size_t length)
 
int Compare (const BigInteger &rhs) const
 
bool Difference (const BigInteger &rhs, BigInteger *out) const
 
size_t GetCount () const
 
Type GetDigit (size_t index) const
 
bool IsZero () const
 
BigIntegerMultiplyPow5 (unsigned exp)
 
BigIntegeroperator*= (uint64_t u)
 
BigIntegeroperator*= (uint32_t u)
 
BigIntegeroperator+= (uint64_t u)
 
BigIntegeroperator<<= (size_t shift)
 
BigIntegeroperator= (const BigInteger &rhs)
 
BigIntegeroperator= (uint64_t u)
 
bool operator== (const BigInteger &rhs) const
 
bool operator== (const Type rhs) const
 

Private Member Functions

void AppendDecimal64 (const char *begin, const char *end)
 
void PushBack (Type digit)
 

Static Private Member Functions

static uint64_t MulAdd64 (uint64_t a, uint64_t b, uint64_t k, uint64_t *outHigh)
 
static uint64_t ParseUint64 (const char *begin, const char *end)
 

Private Attributes

size_t count_
 
Type digits_ [kCapacity]
 

Static Private Attributes

static const size_t kBitCount = 3328
 
static const size_t kCapacity = kBitCount / sizeof(Type)
 
static const size_t kTypeBit = sizeof(Type) * 8
 

Detailed Description

Definition at line 28 of file biginteger.h.

Member Typedef Documentation

Definition at line 31 of file biginteger.h.

Constructor & Destructor Documentation

internal::BigInteger::BigInteger ( const BigInteger rhs)
inline

Definition at line 33 of file biginteger.h.

internal::BigInteger::BigInteger ( uint64_t  u)
inlineexplicit

Definition at line 38 of file biginteger.h.

internal::BigInteger::BigInteger ( const char *  decimals,
size_t  length 
)
inline

Definition at line 43 of file biginteger.h.

Member Function Documentation

void internal::BigInteger::AppendDecimal64 ( const char *  begin,
const char *  end 
)
inlineprivate

Definition at line 275 of file biginteger.h.

int internal::BigInteger::Compare ( const BigInteger rhs) const
inline

Definition at line 248 of file biginteger.h.

bool internal::BigInteger::Difference ( const BigInteger rhs,
BigInteger out 
) const
inline

Definition at line 214 of file biginteger.h.

size_t internal::BigInteger::GetCount ( ) const
inline

Definition at line 260 of file biginteger.h.

Type internal::BigInteger::GetDigit ( size_t  index) const
inline

Definition at line 264 of file biginteger.h.

bool internal::BigInteger::IsZero ( ) const
inline

Definition at line 269 of file biginteger.h.

static uint64_t internal::BigInteger::MulAdd64 ( uint64_t  a,
uint64_t  b,
uint64_t  k,
uint64_t outHigh 
)
inlinestaticprivate

Definition at line 305 of file biginteger.h.

BigInteger& internal::BigInteger::MultiplyPow5 ( unsigned  exp)
inline

Definition at line 187 of file biginteger.h.

BigInteger& internal::BigInteger::operator*= ( uint64_t  u)
inline

Definition at line 96 of file biginteger.h.

BigInteger& internal::BigInteger::operator*= ( uint32_t  u)
inline

Definition at line 119 of file biginteger.h.

BigInteger& internal::BigInteger::operator+= ( uint64_t  u)
inline

Definition at line 77 of file biginteger.h.

BigInteger& internal::BigInteger::operator<<= ( size_t  shift)
inline

Definition at line 147 of file biginteger.h.

BigInteger& internal::BigInteger::operator= ( const BigInteger rhs)
inline

Definition at line 60 of file biginteger.h.

BigInteger& internal::BigInteger::operator= ( uint64_t  u)
inline

Definition at line 70 of file biginteger.h.

bool internal::BigInteger::operator== ( const BigInteger rhs) const
inline

Definition at line 177 of file biginteger.h.

bool internal::BigInteger::operator== ( const Type  rhs) const
inline

Definition at line 182 of file biginteger.h.

static uint64_t internal::BigInteger::ParseUint64 ( const char *  begin,
const char *  end 
)
inlinestaticprivate

Definition at line 293 of file biginteger.h.

void internal::BigInteger::PushBack ( Type  digit)
inlineprivate

Definition at line 287 of file biginteger.h.

Member Data Documentation

size_t internal::BigInteger::count_
private

Definition at line 341 of file biginteger.h.

Type internal::BigInteger::digits_[kCapacity]
private

Definition at line 340 of file biginteger.h.

const size_t internal::BigInteger::kBitCount = 3328
staticprivate

Definition at line 336 of file biginteger.h.

const size_t internal::BigInteger::kCapacity = kBitCount / sizeof(Type)
staticprivate

Definition at line 337 of file biginteger.h.

const size_t internal::BigInteger::kTypeBit = sizeof(Type) * 8
staticprivate

Definition at line 338 of file biginteger.h.


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


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54