v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Bignum Class Reference

#include <bignum.h>

Public Member Functions

 Bignum ()
 
void AssignUInt16 (uint16_t value)
 
void AssignUInt64 (uint64_t value)
 
void AssignBignum (const Bignum &other)
 
void AssignDecimalString (Vector< const char > value)
 
void AssignHexString (Vector< const char > value)
 
void AssignPowerUInt16 (uint16_t base, int exponent)
 
void AddUInt16 (uint16_t operand)
 
void AddUInt64 (uint64_t operand)
 
void AddBignum (const Bignum &other)
 
void SubtractBignum (const Bignum &other)
 
void Square ()
 
void ShiftLeft (int shift_amount)
 
void MultiplyByUInt32 (uint32_t factor)
 
void MultiplyByUInt64 (uint64_t factor)
 
void MultiplyByPowerOfTen (int exponent)
 
void Times10 ()
 
uint16_t DivideModuloIntBignum (const Bignum &other)
 
bool ToHexString (char *buffer, int buffer_size) const
 

Static Public Member Functions

static int Compare (const Bignum &a, const Bignum &b)
 
static bool Equal (const Bignum &a, const Bignum &b)
 
static bool LessEqual (const Bignum &a, const Bignum &b)
 
static bool Less (const Bignum &a, const Bignum &b)
 
static int PlusCompare (const Bignum &a, const Bignum &b, const Bignum &c)
 
static bool PlusEqual (const Bignum &a, const Bignum &b, const Bignum &c)
 
static bool PlusLessEqual (const Bignum &a, const Bignum &b, const Bignum &c)
 
static bool PlusLess (const Bignum &a, const Bignum &b, const Bignum &c)
 

Static Public Attributes

static const int kMaxSignificantBits = 3584
 

Detailed Description

Definition at line 34 of file bignum.h.

Constructor & Destructor Documentation

Bignum ( )

Definition at line 35 of file bignum.cc.

Member Function Documentation

void AddBignum ( const Bignum other)

Definition at line 172 of file bignum.cc.

References ASSERT, v8::internal::carry, and v8::internal::Max().

Referenced by Bignum::AddUInt64(), and TEST().

void AddUInt16 ( uint16_t  operand)
void AddUInt64 ( uint64_t  operand)

Definition at line 164 of file bignum.cc.

References Bignum::AddBignum(), and Bignum::AssignUInt64().

Referenced by Bignum::AssignDecimalString(), and TEST().

void AssignBignum ( const Bignum other)

Definition at line 78 of file bignum.cc.

Referenced by TEST().

void AssignDecimalString ( Vector< const char >  value)
void AssignHexString ( Vector< const char >  value)

Definition at line 134 of file bignum.cc.

References Vector< T >::length().

void AssignPowerUInt16 ( uint16_t  base,
int  exponent 
)
void AssignUInt16 ( uint16_t  value)

Definition at line 50 of file bignum.cc.

References ASSERT.

Referenced by Bignum::AssignPowerUInt16(), and TEST().

void AssignUInt64 ( uint64_t  value)

Definition at line 61 of file bignum.cc.

Referenced by Bignum::AddUInt64(), Bignum::AssignPowerUInt16(), and TEST().

int Compare ( const Bignum a,
const Bignum b 
)
static

Definition at line 618 of file bignum.cc.

References ASSERT, and v8::internal::Min().

Referenced by Bignum::Equal(), Bignum::Less(), Bignum::LessEqual(), and TEST().

uint16_t DivideModuloIntBignum ( const Bignum other)

Definition at line 489 of file bignum.cc.

References ASSERT, Bignum::LessEqual(), and Bignum::SubtractBignum().

Referenced by TEST().

static bool Equal ( const Bignum a,
const Bignum b 
)
inlinestatic

Definition at line 72 of file bignum.h.

References Bignum::Compare().

Referenced by TEST().

static bool Less ( const Bignum a,
const Bignum b 
)
inlinestatic

Definition at line 78 of file bignum.h.

References Bignum::Compare().

Referenced by TEST().

static bool LessEqual ( const Bignum a,
const Bignum b 
)
inlinestatic

Definition at line 75 of file bignum.h.

References Bignum::Compare().

Referenced by Bignum::DivideModuloIntBignum(), Bignum::SubtractBignum(), and TEST().

void MultiplyByPowerOfTen ( int  exponent)
void MultiplyByUInt32 ( uint32_t  factor)
void MultiplyByUInt64 ( uint64_t  factor)

Definition at line 276 of file bignum.cc.

References ASSERT, and v8::internal::carry.

Referenced by Bignum::MultiplyByPowerOfTen(), and TEST().

int PlusCompare ( const Bignum a,
const Bignum b,
const Bignum c 
)
static

Definition at line 636 of file bignum.cc.

References ASSERT, and v8::internal::Min().

Referenced by Bignum::PlusEqual(), Bignum::PlusLess(), Bignum::PlusLessEqual(), and TEST().

static bool PlusEqual ( const Bignum a,
const Bignum b,
const Bignum c 
)
inlinestatic

Definition at line 84 of file bignum.h.

References Bignum::PlusCompare().

Referenced by TEST().

static bool PlusLess ( const Bignum a,
const Bignum b,
const Bignum c 
)
inlinestatic

Definition at line 92 of file bignum.h.

References Bignum::PlusCompare().

Referenced by TEST().

static bool PlusLessEqual ( const Bignum a,
const Bignum b,
const Bignum c 
)
inlinestatic

Definition at line 88 of file bignum.h.

References Bignum::PlusCompare().

Referenced by TEST().

void ShiftLeft ( int  shift_amount)

Definition at line 241 of file bignum.cc.

Referenced by Bignum::AssignPowerUInt16(), Bignum::MultiplyByPowerOfTen(), and TEST().

void Square ( )

Definition at line 343 of file bignum.cc.

References ASSERT, and UNIMPLEMENTED.

Referenced by Bignum::AssignPowerUInt16(), and TEST().

void SubtractBignum ( const Bignum other)

Definition at line 214 of file bignum.cc.

References ASSERT, and Bignum::LessEqual().

Referenced by Bignum::DivideModuloIntBignum(), and TEST().

void Times10 ( )
inline

Definition at line 62 of file bignum.h.

References Bignum::MultiplyByUInt32().

bool ToHexString ( char *  buffer,
int  buffer_size 
) const

Definition at line 571 of file bignum.cc.

References ASSERT.

Referenced by TEST().

Field Documentation

const int kMaxSignificantBits = 3584
static

Definition at line 39 of file bignum.h.

Referenced by v8::internal::BignumDtoa().


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