yosys-master
|
#include <BigInteger.hh>
Public Types | |
enum | Sign { negative = -1, zero = 0, positive = 1 } |
typedef BigUnsigned::Blk | Blk |
typedef BigUnsigned::Index | Index |
typedef BigUnsigned::CmpRes | CmpRes |
Public Member Functions | |
BigInteger () | |
BigInteger (const BigInteger &x) | |
void | operator= (const BigInteger &x) |
BigInteger (const Blk *b, Index blen, Sign s) | |
BigInteger (const Blk *b, Index blen) | |
BigInteger (const BigUnsigned &x, Sign s) | |
BigInteger (const BigUnsigned &x) | |
BigInteger (unsigned long x) | |
BigInteger (long x) | |
BigInteger (unsigned int x) | |
BigInteger (int x) | |
BigInteger (unsigned short x) | |
BigInteger (short x) | |
unsigned long | toUnsignedLong () const |
long | toLong () const |
unsigned int | toUnsignedInt () const |
int | toInt () const |
unsigned short | toUnsignedShort () const |
short | toShort () const |
Sign | getSign () const |
const BigUnsigned & | getMagnitude () const |
Index | getLength () const |
Index | getCapacity () const |
Blk | getBlock (Index i) const |
bool | isZero () const |
CmpRes | compareTo (const BigInteger &x) const |
bool | operator== (const BigInteger &x) const |
bool | operator!= (const BigInteger &x) const |
bool | operator< (const BigInteger &x) const |
bool | operator<= (const BigInteger &x) const |
bool | operator>= (const BigInteger &x) const |
bool | operator> (const BigInteger &x) const |
void | add (const BigInteger &a, const BigInteger &b) |
void | subtract (const BigInteger &a, const BigInteger &b) |
void | multiply (const BigInteger &a, const BigInteger &b) |
void | divideWithRemainder (const BigInteger &b, BigInteger &q) |
void | negate (const BigInteger &a) |
BigInteger | operator+ (const BigInteger &x) const |
BigInteger | operator- (const BigInteger &x) const |
BigInteger | operator* (const BigInteger &x) const |
BigInteger | operator/ (const BigInteger &x) const |
BigInteger | operator% (const BigInteger &x) const |
BigInteger | operator- () const |
void | operator+= (const BigInteger &x) |
void | operator-= (const BigInteger &x) |
void | operator*= (const BigInteger &x) |
void | operator/= (const BigInteger &x) |
void | operator%= (const BigInteger &x) |
void | flipSign () |
void | operator++ () |
void | operator++ (int) |
void | operator-- () |
void | operator-- (int) |
Static Public Attributes | |
static const CmpRes | less = BigUnsigned::less |
static const CmpRes | equal = BigUnsigned::equal |
static const CmpRes | greater = BigUnsigned::greater |
Protected Member Functions | |
template<class X > | |
X | convertToUnsignedPrimitive () const |
template<class X , class UX > | |
X | convertToSignedPrimitive () const |
Protected Attributes | |
Sign | sign |
BigUnsigned | mag |
Definition at line 13 of file BigInteger.hh.
typedef BigUnsigned::Blk BigInteger::Blk |
Definition at line 16 of file BigInteger.hh.
Definition at line 18 of file BigInteger.hh.
typedef BigUnsigned::Index BigInteger::Index |
Definition at line 17 of file BigInteger.hh.
enum BigInteger::Sign |
Enumerator | |
---|---|
negative | |
zero | |
positive |
Definition at line 24 of file BigInteger.hh.
|
inline |
Definition at line 32 of file BigInteger.hh.
|
inline |
Definition at line 35 of file BigInteger.hh.
Definition at line 13 of file BigInteger.cc.
Definition at line 44 of file BigInteger.hh.
BigInteger::BigInteger | ( | const BigUnsigned & | x, |
Sign | s | ||
) |
Definition at line 32 of file BigInteger.cc.
|
inline |
Definition at line 52 of file BigInteger.hh.
BigInteger::BigInteger | ( | unsigned long | x | ) |
Definition at line 56 of file BigInteger.cc.
BigInteger::BigInteger | ( | long | x | ) |
Definition at line 77 of file BigInteger.cc.
BigInteger::BigInteger | ( | unsigned int | x | ) |
Definition at line 57 of file BigInteger.cc.
BigInteger::BigInteger | ( | int | x | ) |
Definition at line 78 of file BigInteger.cc.
BigInteger::BigInteger | ( | unsigned short | x | ) |
Definition at line 58 of file BigInteger.cc.
BigInteger::BigInteger | ( | short | x | ) |
Definition at line 79 of file BigInteger.cc.
void BigInteger::add | ( | const BigInteger & | a, |
const BigInteger & | b | ||
) |
Definition at line 169 of file BigInteger.cc.
BigInteger::CmpRes BigInteger::compareTo | ( | const BigInteger & | x | ) | const |
Definition at line 135 of file BigInteger.cc.
|
protected |
Definition at line 104 of file BigInteger.cc.
|
protected |
Definition at line 93 of file BigInteger.cc.
void BigInteger::divideWithRemainder | ( | const BigInteger & | b, |
BigInteger & | q | ||
) |
Definition at line 280 of file BigInteger.cc.
|
inline |
Definition at line 211 of file BigInteger.hh.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 89 of file BigInteger.hh.
void BigInteger::multiply | ( | const BigInteger & | a, |
const BigInteger & | b | ||
) |
Definition at line 243 of file BigInteger.cc.
void BigInteger::negate | ( | const BigInteger & | a | ) |
|
inline |
|
inline |
Definition at line 166 of file BigInteger.hh.
|
inline |
Definition at line 204 of file BigInteger.hh.
|
inline |
Definition at line 154 of file BigInteger.hh.
|
inline |
Definition at line 192 of file BigInteger.hh.
|
inline |
Definition at line 144 of file BigInteger.hh.
void BigInteger::operator++ | ( | ) |
Definition at line 373 of file BigInteger.cc.
void BigInteger::operator++ | ( | int | ) |
|
inline |
|
inline |
Definition at line 149 of file BigInteger.hh.
|
inline |
Definition at line 173 of file BigInteger.hh.
void BigInteger::operator-- | ( | ) |
Definition at line 390 of file BigInteger.cc.
void BigInteger::operator-- | ( | int | ) |
|
inline |
Definition at line 189 of file BigInteger.hh.
|
inline |
Definition at line 159 of file BigInteger.hh.
|
inline |
Definition at line 195 of file BigInteger.hh.
|
inline |
|
inline |
void BigInteger::operator= | ( | const BigInteger & | x | ) |
|
inline |
|
inline |
|
inline |
void BigInteger::subtract | ( | const BigInteger & | a, |
const BigInteger & | b | ||
) |
Definition at line 203 of file BigInteger.cc.
int BigInteger::toInt | ( | ) | const |
long BigInteger::toLong | ( | ) | const |
Definition at line 130 of file BigInteger.cc.
short BigInteger::toShort | ( | ) | const |
Definition at line 132 of file BigInteger.cc.
unsigned int BigInteger::toUnsignedInt | ( | ) | const |
Definition at line 128 of file BigInteger.cc.
unsigned long BigInteger::toUnsignedLong | ( | ) | const |
Definition at line 127 of file BigInteger.cc.
unsigned short BigInteger::toUnsignedShort | ( | ) | const |
Definition at line 129 of file BigInteger.cc.
|
static |
Definition at line 21 of file BigInteger.hh.
|
static |
Definition at line 22 of file BigInteger.hh.
|
static |
Definition at line 20 of file BigInteger.hh.
|
protected |
Definition at line 28 of file BigInteger.hh.
|
protected |
Definition at line 27 of file BigInteger.hh.