![]() |
TTMath
0.9.4
C++ bignum library
|
Int implements a big integer value with a sign. More...
#include <ttmathint.h>
Public Member Functions | |
void | SetMax () |
void | SetMin () |
void | SetSignOne () |
uint | ChangeSign () |
void | SetSign () |
bool | IsSign () const |
uint | Abs () |
uint | Add (const Int< value_size > &ss2) |
uint | AddInt (uint value, uint index=0) |
uint | AddTwoInts (uint x2, uint x1, uint index) |
uint | Sub (const Int< value_size > &ss2) |
uint | SubInt (uint value, uint index=0) |
uint | AddOne () |
uint | SubOne () |
uint | MulInt (sint ss2) |
uint | Mul (Int< value_size > ss2) |
uint | Div (Int< value_size > ss2, Int< value_size > *remainder=0) |
uint | Div (const Int< value_size > &ss2, Int< value_size > &remainder) |
uint | DivInt (sint ss2, sint *remainder=0) |
uint | DivInt (sint ss2, sint &remainder) |
uint | Pow (Int< value_size > pow) |
template<uint argument_size> | |
uint | FromInt (const Int< argument_size > &p) |
uint | FromInt (sint value) |
template<uint argument_size> | |
uint | FromUInt (const UInt< argument_size > &p) |
template<uint argument_size> | |
uint | FromInt (const UInt< argument_size > &p) |
uint | FromUInt (uint value) |
uint | FromInt (uint value) |
Int< value_size > & | operator= (const Int< value_size > &p) |
template<uint argument_size> | |
Int< value_size > & | operator= (const Int< argument_size > &p) |
Int< value_size > & | operator= (sint i) |
Int (sint i) | |
Int (const Int< value_size > &u) | |
template<uint argument_size> | |
Int (const Int< argument_size > &u) | |
template<uint argument_size> | |
Int< value_size > & | operator= (const UInt< argument_size > &p) |
Int< value_size > & | operator= (uint i) |
Int (uint i) | |
template<uint argument_size> | |
Int (const UInt< argument_size > &u) | |
uint | FromUInt (unsigned int i) |
uint | FromInt (unsigned int i) |
uint | FromInt (signed int i) |
Int< value_size > & | operator= (unsigned int i) |
Int (unsigned int i) | |
Int< value_size > & | operator= (signed int i) |
Int (signed int i) | |
Int (const char *s) | |
Int (const std::string &s) | |
Int (const wchar_t *s) | |
Int (const std::wstring &s) | |
Int () | |
~Int () | |
sint | ToInt () const |
uint | ToUInt (uint &result) const |
uint | ToInt (uint &result) const |
uint | ToInt (sint &result) const |
uint | ToUInt (unsigned int &result) const |
uint | ToInt (unsigned int &result) const |
uint | ToInt (int &result) const |
void | ToString (std::string &result, uint b=10) const |
std::string | ToString (uint b=10) const |
void | ToString (std::wstring &result, uint b=10) const |
std::wstring | ToWString (uint b=10) const |
uint | FromString (const char *s, uint b=10, const char **after_source=0, bool *value_read=0) |
uint | FromString (const wchar_t *s, uint b=10, const wchar_t **after_source=0, bool *value_read=0) |
uint | FromString (const std::string &s, uint b=10) |
Int< value_size > & | operator= (const char *s) |
uint | FromString (const std::wstring &s, uint b=10) |
Int< value_size > & | operator= (const wchar_t *s) |
Int< value_size > & | operator= (const std::wstring &s) |
Int< value_size > & | operator= (const std::string &s) |
bool | operator== (const Int< value_size > &l) const |
bool | operator!= (const Int< value_size > &l) const |
bool | operator< (const Int< value_size > &l) const |
bool | operator> (const Int< value_size > &l) const |
bool | operator<= (const Int< value_size > &l) const |
bool | operator>= (const Int< value_size > &l) const |
Int< value_size > | operator- () const |
Int< value_size > | operator- (const Int< value_size > &p2) const |
Int< value_size > & | operator-= (const Int< value_size > &p2) |
Int< value_size > | operator+ (const Int< value_size > &p2) const |
Int< value_size > & | operator+= (const Int< value_size > &p2) |
Int< value_size > | operator* (const Int< value_size > &p2) const |
Int< value_size > & | operator*= (const Int< value_size > &p2) |
Int< value_size > | operator/ (const Int< value_size > &p2) const |
Int< value_size > & | operator/= (const Int< value_size > &p2) |
Int< value_size > | operator% (const Int< value_size > &p2) const |
Int< value_size > & | operator%= (const Int< value_size > &p2) |
UInt< value_size > & | operator++ () |
UInt< value_size > | operator++ (int) |
UInt< value_size > & | operator-- () |
UInt< value_size > | operator-- (int) |
template<class ostream_type > | |
void | PrintTable (ostream_type &output) const |
template<class char_type , class ostream_type > | |
void | PrintLog (const char_type *msg, ostream_type &output) const |
template<class char_type , class ostream_type > | |
void | PrintLog (const char_type *msg, uint carry, ostream_type &output) const |
uint | Size () const |
void | SetZero () |
void | SetOne () |
void | Swap (UInt< value_size > &ss2) |
void | SetFromTable (const unsigned int *temp_table, uint temp_table_len) |
uint | Rcl (uint bits, uint c=0) |
uint | Rcr (uint bits, uint c=0) |
uint | CompensationToLeft () |
bool | FindLeadingBit (uint &table_id, uint &index) const |
bool | FindLowestBit (uint &table_id, uint &index) const |
uint | GetBit (uint bit_index) const |
uint | SetBit (uint bit_index) |
void | BitAnd (const UInt< value_size > &ss2) |
void | BitOr (const UInt< value_size > &ss2) |
void | BitXor (const UInt< value_size > &ss2) |
void | BitNot () |
void | BitNot2 () |
uint | MulInt (uint ss2) |
template<uint result_size> | |
void | MulInt (uint ss2, UInt< result_size > &result) const |
uint | Mul (const UInt< value_size > &ss2, uint algorithm=100) |
void | MulBig (const UInt< value_size > &ss2, UInt< value_size *2 > &result, uint algorithm=100) |
uint | Mul1 (const UInt< value_size > &ss2) |
void | Mul1Big (const UInt< value_size > &ss2_, UInt< value_size *2 > &result) |
uint | Mul2 (const UInt< value_size > &ss2) |
void | Mul2Big (const UInt< value_size > &ss2, UInt< value_size *2 > &result) |
uint | Mul3 (const UInt< value_size > &ss2) |
void | Mul3Big (const UInt< value_size > &ss2, UInt< value_size *2 > &result) |
uint | MulFastest (const UInt< value_size > &ss2) |
void | MulFastestBig (const UInt< value_size > &ss2, UInt< value_size *2 > &result) |
uint | DivInt (uint divisor, uint *remainder=0) |
uint | DivInt (uint divisor, uint &remainder) |
uint | Div (const UInt< value_size > &divisor, UInt< value_size > *remainder=0, uint algorithm=3) |
uint | Div (const UInt< value_size > &divisor, UInt< value_size > &remainder, uint algorithm=3) |
uint | Div1 (const UInt< value_size > &divisor, UInt< value_size > *remainder=0) |
uint | Div1 (const UInt< value_size > &divisor, UInt< value_size > &remainder) |
uint | Div2 (const UInt< value_size > &divisor, UInt< value_size > *remainder=0) |
uint | Div2 (const UInt< value_size > &divisor, UInt< value_size > &remainder) |
uint | Div3 (const UInt< value_size > &ss2, UInt< value_size > *remainder=0) |
uint | Div3 (const UInt< value_size > &ss2, UInt< value_size > &remainder) |
uint | Pow (UInt< value_size > pow) |
void | Sqrt () |
void | ClearFirstBits (uint n) |
bool | IsTheHighestBitSet () const |
bool | IsTheLowestBitSet () const |
bool | IsOnlyTheHighestBitSet () const |
bool | IsOnlyTheLowestBitSet () const |
bool | IsZero () const |
bool | AreFirstBitsZero (uint bits) const |
uint | ToUInt () const |
template<class string_type > | |
void | ToStringBase (string_type &result, uint b=10, bool negative=false) const |
bool | CmpSmaller (const UInt< value_size > &l, sint index=-1) const |
bool | CmpBigger (const UInt< value_size > &l, sint index=-1) const |
bool | CmpEqual (const UInt< value_size > &l, sint index=-1) const |
bool | CmpSmallerEqual (const UInt< value_size > &l, sint index=-1) const |
bool | CmpBiggerEqual (const UInt< value_size > &l, sint index=-1) const |
bool | operator< (const UInt< value_size > &l) const |
bool | operator> (const UInt< value_size > &l) const |
bool | operator== (const UInt< value_size > &l) const |
bool | operator!= (const UInt< value_size > &l) const |
bool | operator<= (const UInt< value_size > &l) const |
bool | operator>= (const UInt< value_size > &l) const |
UInt< value_size > | operator- (const UInt< value_size > &p2) const |
UInt< value_size > & | operator-= (const UInt< value_size > &p2) |
UInt< value_size > | operator+ (const UInt< value_size > &p2) const |
UInt< value_size > & | operator+= (const UInt< value_size > &p2) |
UInt< value_size > | operator* (const UInt< value_size > &p2) const |
UInt< value_size > & | operator*= (const UInt< value_size > &p2) |
UInt< value_size > | operator/ (const UInt< value_size > &p2) const |
UInt< value_size > & | operator/= (const UInt< value_size > &p2) |
UInt< value_size > | operator% (const UInt< value_size > &p2) const |
UInt< value_size > & | operator%= (const UInt< value_size > &p2) |
UInt< value_size > | operator~ () const |
UInt< value_size > | operator & (const UInt< value_size > &p2) const |
UInt< value_size > & | operator &= (const UInt< value_size > &p2) |
UInt< value_size > | operator| (const UInt< value_size > &p2) const |
UInt< value_size > & | operator|= (const UInt< value_size > &p2) |
UInt< value_size > | operator^ (const UInt< value_size > &p2) const |
UInt< value_size > & | operator^= (const UInt< value_size > &p2) |
UInt< value_size > | operator>> (int move) const |
UInt< value_size > & | operator>>= (int move) |
UInt< value_size > | operator<< (int move) const |
UInt< value_size > & | operator<<= (int move) |
uint | Add (const UInt< value_size > &ss2, uint c=0) |
uint | Sub (const UInt< value_size > &ss2, uint c=0) |
Static Public Member Functions | |
template<class char_type , class ostream_type > | |
static void | PrintVectorLog (const char_type *msg, ostream_type &output, const uint *vector, uint vector_len) |
template<class char_type , class ostream_type > | |
static void | PrintVectorLog (const char_type *msg, uint carry, ostream_type &output, const uint *vector, uint vector_len) |
static uint | AddTwoWords (uint a, uint b, uint carry, uint *result) |
static uint | SubTwoWords (uint a, uint b, uint carry, uint *result) |
static void | DivTwoWords2 (uint a, uint b, uint c, uint *r, uint *rest) |
static uint | DivTwoWordsNormalize (uint_ &a_, uint_ &b_, uint_ &c_) |
static uint | DivTwoWordsUnnormalize (uint u, uint d) |
static unsigned int | DivTwoWordsCalculate (uint_ u_, unsigned int u3, uint_ v_) |
static void | MultiplySubtract (uint_ &u_, unsigned int &u3, unsigned int &q, uint_ v_) |
static const char * | LibTypeStr () |
static LibTypeCode | LibType () |
static uint | AddVector (const uint *ss1, const uint *ss2, uint ss1_size, uint ss2_size, uint *result) |
static uint | SubVector (const uint *ss1, const uint *ss2, uint ss1_size, uint ss2_size, uint *result) |
static sint | FindLeadingBitInWord (uint x) |
static sint | FindLowestBitInWord (uint x) |
static uint | SetBitInWord (uint &value, uint bit) |
static void | MulTwoWords (uint a, uint b, uint *result_high, uint *result_low) |
static void | DivTwoWords (uint a, uint b, uint c, uint *r, uint *rest) |
Data Fields | |
uint | table [value_size] |
Protected Member Functions | |
double | ToStringLog2 (uint x) const |
Friends | |
std::ostream & | operator<< (std::ostream &s, const Int< value_size > &l) |
std::wostream & | operator<< (std::wostream &s, const Int< value_size > &l) |
std::istream & | operator>> (std::istream &s, Int< value_size > &l) |
std::wistream & | operator>> (std::wistream &s, Int< value_size > &l) |
Int implements a big integer value with a sign.
value_size - how many bytes specify our value
Definition at line 63 of file ttmathint.h.
ttmath::Int< value_size >::Int | ( | sint | i | ) |
ttmath::Int< value_size >::Int | ( | const Int< value_size > & | u | ) |
ttmath::Int< value_size >::Int | ( | const Int< argument_size > & | u | ) |
ttmath::Int< value_size >::Int | ( | uint | i | ) |
ttmath::Int< value_size >::Int | ( | const UInt< argument_size > & | u | ) |
ttmath::Int< value_size >::Int | ( | unsigned int | i | ) |
a constructor for converting 32 bit unsigned int to this class this constructor is created only on a 64bit platform***
Definition at line 1037 of file ttmathint.h.
ttmath::Int< value_size >::Int | ( | signed int | i | ) |
a constructor for converting 32 bit signed int to this class this constructor is created only on a 64bit platform***
Definition at line 1059 of file ttmathint.h.
ttmath::Int< value_size >::Int | ( | const char * | s | ) |
a constructor for converting string to this class (with the base=10)
Definition at line 1071 of file ttmathint.h.
ttmath::Int< value_size >::Int | ( | const std::string & | s | ) |
a constructor for converting a string to this class (with the base=10)
Definition at line 1080 of file ttmathint.h.
ttmath::Int< value_size >::Int | ( | const wchar_t * | s | ) |
a constructor for converting string to this class (with the base=10)
Definition at line 1091 of file ttmathint.h.
ttmath::Int< value_size >::Int | ( | const std::wstring & | s | ) |
a constructor for converting a string to this class (with the base=10)
Definition at line 1100 of file ttmathint.h.
ttmath::Int< value_size >::Int | ( | ) |
a default constructor
we don't clear table etc.
Definition at line 1113 of file ttmathint.h.
Referenced by ttmath::Int< exp >::Int().
ttmath::Int< value_size >::~Int | ( | ) |
uint ttmath::Int< value_size >::Abs | ( | ) |
it sets an absolute value
it can return carry (1) (look on ChangeSign() for details)
Definition at line 168 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::Add(), ttmath::Big< exp, man >::BitAnd(), ttmath::Big< exp, man >::BitOr(), ttmath::Big< exp, man >::BitXor(), ttmath::Int< exp >::Div(), ttmath::Int< exp >::DivInt(), ttmath::Int< exp >::Mul(), ttmath::Int< exp >::MulInt(), and ttmath::Int< exp >::ToInt().
uint ttmath::Int< value_size >::Add | ( | const Int< value_size > & | ss2 | ) |
this method adds two value with a sign and returns a carry
we're using methods from the base class because values are stored with U2 we must only make the carry correction
this = p1(=this) + p2
when p1>=0 i p2>=0 carry is set when the highest bit of value is set when p1<0 i p2<0 carry is set when the highest bit of value is clear when p1>=0 i p2<0 carry will never be set when p1<0 i p2>=0 carry will never be set
Definition at line 220 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::Exp(), ttmath::Big< exp, man >::MulUInt(), and ttmath::Int< exp >::operator-().
|
inherited |
basic mathematic functions
this method adding ss2 to the this and adding carry if it's defined (this = this + ss2 + c)
this method is created only on a 64bit platform***
c must be zero or one (might be a bigger value than 1) function returns carry (1) (if it was)
Definition at line 158 of file ttmathuint_x86_64.h.
Referenced by ttmath::Int< exp >::Add(), ttmath::UInt< man >::Div1(), ttmath::UInt< man >::MulBig(), ttmath::UInt< man >::operator-(), ttmath::UInt< man >::Sqrt(), and ttmath::UInt< man >::ToString().
uint ttmath::Int< value_size >::AddInt | ( | uint | value, |
uint | index = 0 |
||
) |
this method adds one unsigned word (at a specific position) and returns a carry (if it was)
look at a description in UInt<>::AddInt(...)
Definition at line 237 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::FromBig().
uint ttmath::Int< value_size >::AddOne | ( | ) |
this method adds one to the value and returns carry
Definition at line 327 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::ChangeSign(), ttmath::Big< exp, man >::Exp(), and ttmath::Int< exp >::operator++().
uint ttmath::Int< value_size >::AddTwoInts | ( | uint | x2, |
uint | x1, | ||
uint | index | ||
) |
this method adds two unsigned words to the existing value and these words begin on the 'index' position
index should be equal or smaller than value_size-2 (index <= value_size-2) x1 - lower word, x2 - higher word
look at a description in UInt<>::AddTwoInts(...)
Definition at line 256 of file ttmathint.h.
|
staticinherited |
this static method addes one vector to the other 'ss1' is larger in size or equal to 'ss2'
result - is the result vector (which has size the same as ss1: ss1_size)
Example: ss1_size is 5, ss2_size is 3 ss1: ss2: result (output): 5 1 5+1 4 3 4+3 2 7 2+7 6 6 9 9 of course the carry is propagated and will be returned from the last item (this method is used by the Karatsuba multiplication algorithm)
Definition at line 387 of file ttmathuint_x86_64.h.
|
inherited |
|
inherited |
this method performs a bitwise operation AND
Definition at line 743 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::BitAnd(), and ttmath::UInt< man >::operator~().
|
inherited |
this method performs a bitwise operation NOT
Definition at line 779 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::operator~().
|
inherited |
this method performs a bitwise operation NOT but only on the range of <0, leading_bit>
for example: BitNot2(8) = BitNot2( 1000(bin) ) = 111(bin) = 7
Definition at line 795 of file ttmathuint.h.
|
inherited |
this method performs a bitwise operation OR
Definition at line 755 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::BitOr(), and ttmath::UInt< man >::operator~().
|
inherited |
this method performs a bitwise operation XOR
Definition at line 767 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::BitXor(), and ttmath::UInt< man >::operator~().
uint ttmath::Int< value_size >::ChangeSign | ( | ) |
we change the sign of the value
if it isn't possible to change the sign this method returns 1 else return 0 and changing the sign
Definition at line 105 of file ttmathint.h.
Referenced by ttmath::Int< exp >::Abs(), ttmath::Int< exp >::DivInt(), ttmath::Big< exp, man >::FromInt(), ttmath::Int< exp >::operator-(), ttmath::Int< exp >::Pow(), ttmath::Big< exp, man >::Pow(), ttmath::Int< exp >::SetSign(), ttmath::Big< exp, man >::ToInt(), and ttmath::Int< exp >::ToWString().
|
inherited |
this method sets n first bits to value zero
For example: let n=2 then if there's a value 111 (bin) there'll be '100' (bin)
Definition at line 2508 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::SkipFraction().
|
inherited |
this method returns true if 'this' is bigger than 'l'
'index' is an index of the first word from will be the comparison performed (note: we start the comparison from back - from the last word, when index is -1 /default/ it is automatically set into the last word)
I introduced it for some kind of optimization made in the second division algorithm (Div2)
Definition at line 3606 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::CmpBiggerEqual().
|
inherited |
this method returns true if 'this' is bigger than or equal 'l'
'index' is an index of the first word from will be the comparison performed (note: we start the comparison from back - from the last word, when index is -1 /default/ it is automatically set into the last word)
Definition at line 3689 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::CmpBiggerEqual(), and ttmath::UInt< man >::Div2().
|
inherited |
this method returns true if 'this' is equal 'l'
'index' is an index of the first word from will be the comparison performed (note: we start the comparison from back - from the last word, when index is -1 /default/ it is automatically set into the last word)
Definition at line 3634 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::CmpBiggerEqual().
|
inherited |
methods for comparing
this method returns true if 'this' is smaller than 'l'
'index' is an index of the first word from will be the comparison performed (note: we start the comparison from back - from the last word, when index is -1 /default/ it is automatically set into the last word) I introduced it for some kind of optimization made in the second division algorithm (Div2)
Definition at line 3575 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::CmpBiggerEqual().
|
inherited |
this method returns true if 'this' is smaller than or equal 'l'
'index' is an index of the first word from will be the comparison performed (note: we start the comparison from back - from the last word, when index is -1 /default/ it is automatically set into the last word)
Definition at line 3660 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::CmpBiggerEqual().
|
inherited |
this method moves all bits into the left side (it returns value how many bits have been moved)
Definition at line 598 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::FromInt(), ttmath::Big< exp, man >::FromUInt(), ttmath::Big< exp, man >::Mul(), ttmath::Big< exp, man >::MulUInt(), and ttmath::Big< exp, man >::Standardizing().
uint ttmath::Int< value_size >::Div | ( | Int< value_size > | ss2, |
Int< value_size > * | remainder = 0 |
||
) |
division this = this / ss2 returned values:
for example: (result means 'this')
in other words: this(old) = ss2 * this(new)(result) + remainder
Definition at line 480 of file ttmathint.h.
Referenced by ttmath::Int< exp >::Div(), ttmath::Int< exp >::operator-(), and ttmath::Int< exp >::Pow().
|
inherited |
division this = this / ss2
return values:
Definition at line 1626 of file ttmathuint.h.
Referenced by ttmath::Int< exp >::Div(), ttmath::UInt< man >::Div(), ttmath::Big< exp, man >::Mul(), and ttmath::UInt< man >::operator-().
|
inherited |
the first division algorithm (radix 2)
Definition at line 1752 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Div(), and ttmath::UInt< man >::Div1().
|
inherited |
the first division algorithm (radix 2)
Definition at line 1775 of file ttmathuint.h.
|
inherited |
the second division algorithm
return values:
Definition at line 1862 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Div(), and ttmath::UInt< man >::Div2().
|
inherited |
the second division algorithm
return values:
Definition at line 1883 of file ttmathuint.h.
|
inherited |
the third division algorithm
Definition at line 2108 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Div(), and ttmath::UInt< man >::Div3().
|
inherited |
the third division algorithm
Definition at line 2125 of file ttmathuint.h.
uint ttmath::Int< value_size >::DivInt | ( | sint | ss2, |
sint * | remainder = 0 |
||
) |
division this = this / ss2 (ss2 is int) returned values:
for example: (result means 'this')
in other words: this(old) = ss2 * this(new)(result) + remainder
Definition at line 524 of file ttmathint.h.
Referenced by ttmath::Int< exp >::DivInt().
|
inherited |
Division
division by one unsigned word
returns 1 when divisor is zero
Definition at line 1568 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Div3(), ttmath::Int< exp >::DivInt(), and ttmath::UInt< man >::ToStringBase().
|
staticinherited |
Division
this method calculates 64bits word a:b / 32bits c (a higher, b lower word) r = a:b / c and rest - remainder
this method is created only on a 64bit platform***
WARNING: if r (one word) is too small for the result or c is equal zero there'll be a hardware interruption (0) and probably the end of your program
Definition at line 1132 of file ttmathuint_x86_64.h.
|
inherited |
this method looks for the highest set bit
result:
Definition at line 649 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::BitNot2(), and ttmath::UInt< man >::ToStringBase().
|
inherited |
this method looks for the smallest set bit
result:
Definition at line 681 of file ttmathuint.h.
uint ttmath::Int< value_size >::FromInt | ( | const Int< argument_size > & | p | ) |
this method converts an Int<another_size> type into this class
this operation has mainly sense if the value from p can be held in this type
it returns a carry if the value 'p' is too big
Definition at line 697 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::FromBig(), ttmath::Int< exp >::FromInt(), ttmath::Int< exp >::Int(), and ttmath::Int< exp >::operator=().
uint ttmath::Int< value_size >::FromInt | ( | sint | value | ) |
uint ttmath::Int< value_size >::FromInt | ( | const UInt< argument_size > & | p | ) |
this method converts UInt<another_size> into this class
Definition at line 734 of file ttmathint.h.
uint ttmath::Int< value_size >::FromInt | ( | uint | value | ) |
uint ttmath::Int< value_size >::FromInt | ( | unsigned int | i | ) |
this method converts 32 bit unsigned int type to this class this operator is created only on a 64bit platform***
Definition at line 1005 of file ttmathint.h.
uint ttmath::Int< value_size >::FromInt | ( | signed int | i | ) |
this method converts 32 bit signed int type to this class this operator is created only on a 64bit platform***
Definition at line 1015 of file ttmathint.h.
uint ttmath::Int< value_size >::FromString | ( | const char * | s, |
uint | b = 10 , |
||
const char ** | after_source = 0 , |
||
bool * | value_read = 0 |
||
) |
this method converts a string into its value it returns carry=1 if the value will be too big or an incorrect base 'b' is given
string is ended with a non-digit value, for example: "-12" will be translated to -12 as well as: "- 12foo" will be translated to -12 too
existing first white characters will be ommited (between '-' and a first digit can be white characters too)
after_source (if exists) is pointing at the end of the parsed string
value_read (if exists) tells whether something has actually been read (at least one digit)
Definition at line 1453 of file ttmathint.h.
Referenced by ttmath::Int< exp >::FromString(), ttmath::Int< exp >::Int(), and ttmath::Int< exp >::operator=().
uint ttmath::Int< value_size >::FromString | ( | const wchar_t * | s, |
uint | b = 10 , |
||
const wchar_t ** | after_source = 0 , |
||
bool * | value_read = 0 |
||
) |
this method converts a string into its value
Definition at line 1462 of file ttmathint.h.
uint ttmath::Int< value_size >::FromString | ( | const std::string & | s, |
uint | b = 10 |
||
) |
this method converts a string into its value it returns carry=1 if the value will be too big or an incorrect base 'b' is given
Definition at line 1472 of file ttmathint.h.
uint ttmath::Int< value_size >::FromString | ( | const std::wstring & | s, |
uint | b = 10 |
||
) |
this method converts a string into its value it returns carry=1 if the value will be too big or an incorrect base 'b' is given
Definition at line 1496 of file ttmathint.h.
uint ttmath::Int< value_size >::FromUInt | ( | const UInt< argument_size > & | p | ) |
this method converts UInt<another_size> into this class
Definition at line 724 of file ttmathint.h.
Referenced by ttmath::Int< exp >::FromInt(), ttmath::Int< exp >::FromUInt(), ttmath::Int< exp >::Int(), and ttmath::Int< exp >::operator=().
uint ttmath::Int< value_size >::FromUInt | ( | uint | value | ) |
uint ttmath::Int< value_size >::FromUInt | ( | unsigned int | i | ) |
this method converts 32 bit unsigned int type to this class this operator is created only on a 64bit platform***
Definition at line 995 of file ttmathint.h.
|
inherited |
getting the 'bit_index' bit
bit_index bigger or equal zero
Definition at line 706 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::Mod2().
|
inherited |
|
inherited |
bool ttmath::Int< value_size >::IsSign | ( | ) | const |
this method returns true if there's the sign
(the highest bit will be converted to the bool)
Definition at line 156 of file ttmathint.h.
Referenced by ttmath::Int< exp >::Abs(), ttmath::Int< exp >::Add(), ttmath::Int< exp >::AddInt(), ttmath::Int< exp >::AddOne(), ttmath::Int< exp >::AddTwoInts(), ttmath::Int< exp >::Div(), ttmath::Int< exp >::DivInt(), ttmath::Big< exp, man >::FromInt(), ttmath::Big< exp, man >::FromString(), ttmath::Big< exp, man >::IsInteger(), ttmath::Int< exp >::Mul(), ttmath::Int< exp >::MulInt(), ttmath::Int< exp >::Pow(), ttmath::Big< exp, man >::Pow(), ttmath::Big< exp, man >::RemainFraction(), ttmath::Int< exp >::SetSign(), ttmath::Big< exp, man >::SkipFraction(), ttmath::Int< exp >::Sub(), ttmath::Int< exp >::SubInt(), ttmath::Int< exp >::SubOne(), ttmath::Int< exp >::ToInt(), and ttmath::Int< exp >::ToUInt().
|
inherited |
this method returns true if the highest bit of the value is set
Definition at line 2547 of file ttmathuint.h.
Referenced by ttmath::Int< exp >::IsSign(), and ttmath::Big< exp, man >::Standardizing().
|
inherited |
this method returns true if the lowest bit of the value is set
Definition at line 2556 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::ChangeSign().
|
inherited |
this method returns true if the value is equal zero
Definition at line 2605 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::FromString(), ttmath::Big< exp, man >::Pow(), ttmath::UInt< man >::Pow(), ttmath::UInt< man >::Sqrt(), ttmath::Big< exp, man >::Standardizing(), and ttmath::UInt< man >::ToStringBase().
|
staticinherited |
returning the currect type of the library
Definition at line 126 of file ttmathuint_x86_64.h.
Referenced by ttmath::Big< exp, man >::LibType().
|
staticinherited |
returning the string represents the currect type of the library we have following types: asm_vc_32 - with asm code designed for Microsoft Visual C++ (32 bits) asm_gcc_32 - with asm code designed for GCC (32 bits) asm_vc_64 - with asm for VC (64 bit) asm_gcc_64 - with asm for GCC (64 bit) no_asm_32 - pure C++ version (32 bit) - without any asm code no_asm_64 - pure C++ version (64 bit) - without any asm code
Definition at line 108 of file ttmathuint_x86_64.h.
Referenced by ttmath::Big< exp, man >::LibTypeStr().
uint ttmath::Int< value_size >::Mul | ( | Int< value_size > | ss2 | ) |
multiplication this = this * ss2
it returns carry if the result is too big (we're using the method from the base class but we have to make one correction in account of signs)
Definition at line 440 of file ttmathint.h.
Referenced by ttmath::Int< exp >::operator-().
|
inherited |
the multiplication 'this' = 'this' * ss2
algorithm: 100 - means automatically choose the fastest algorithm
Definition at line 923 of file ttmathuint.h.
Referenced by ttmath::Int< exp >::Mul(), ttmath::UInt< man >::operator-(), ttmath::UInt< man >::Pow(), and ttmath::UInt< man >::ToString().
|
inherited |
multiplication: this = this * ss2 can return carry
Definition at line 1023 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Mul(), and ttmath::UInt< man >::Mul1Big().
|
inherited |
multiplication: result = this * ss2
result is twice bigger than 'this' and 'ss2' this method never returns carry
Definition at line 1043 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::MulBig().
|
inherited |
the second version of the multiplication algorithm
this algorithm is similar to the 'schoolbook method' which is done by hand
multiplication: this = this * ss2
it returns carry if it has been
Definition at line 1082 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Mul().
|
inherited |
multiplication: result = this * ss2
result is twice bigger than this and ss2 this method never returns carry
Definition at line 1113 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Mul2(), ttmath::UInt< man >::MulBig(), and ttmath::UInt< man >::MulFastestBig().
|
inherited |
multiplication: this = this * ss2
This is Karatsuba Multiplication algorithm, we're using it when value_size is greater than or equal to TTMATH_USE_KARATSUBA_MULTIPLICATION_FROM_SIZE macro (defined in ttmathuint.h). If value_size is smaller then we're using Mul2Big() instead.
Karatsuba multiplication: Assume we have:
this = x = x1*B^m + x0 ss2 = y = y1*B^m + y0
where x0 and y0 are less than B^m the product from multiplication we can show as: x*y = (x1*B^m + x0)(y1*B^m + y0) = z2*B^(2m) + z1*B^m + z0 where
z2 = x1*y1 z1 = x1*y0 + x0*y1 z0 = x0*y0
this is standard schoolbook algorithm with O(n^2), Karatsuba observed that z1 can be given in other form:
z1 = (x1 + x0)*(y1 + y0) - z2 - z0 / z1 = (x1*y1 + x1*y0 + x0*y1 + x0*y0) - x1*y1 - x0*y0 = x1*y0 + x0*y1 /
and to calculate the multiplication we need only three multiplications (with some additions and subtractions)
Our objects 'this' and 'ss2' we divide into two parts and by using recurrence we calculate the multiplication. Karatsuba multiplication has O( n^(ln(3)/ln(2)) )
Definition at line 1212 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Mul().
|
inherited |
multiplication: result = this * ss2
result is twice bigger than this and ss2, this method never returns carry, (Karatsuba multiplication)
Definition at line 1245 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Mul3(), ttmath::UInt< man >::MulBig(), and ttmath::UInt< man >::MulFastestBig().
|
inherited |
the multiplication 'result' = 'this' * ss2
since the 'result' is twice bigger than 'this' and 'ss2' this method never returns a carry
algorithm: 100 - means automatically choose the fastest algorithm
Definition at line 951 of file ttmathuint.h.
|
inherited |
multiplication this = this * ss2
Definition at line 1479 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Mul().
|
inherited |
multiplication result = this * ss2
this method is trying to select the fastest algorithm (in the future this method can be improved)
Definition at line 1510 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::MulBig(), and ttmath::UInt< man >::MulFastest().
uint ttmath::Int< value_size >::MulInt | ( | sint | ss2 | ) |
|
inherited |
Multiplication
multiplication: this = this * ss2
it can return a carry
Definition at line 835 of file ttmathuint.h.
Referenced by ttmath::Int< exp >::MulInt(), and ttmath::Big< exp, man >::MulUInt().
|
inherited |
multiplication: result = this * ss2
we're using this method only when result_size is greater than value_size if so there will not be a carry
Definition at line 873 of file ttmathuint.h.
|
staticinherited |
Multiplication
multiplication: result_high:result_low = a * b
this methos never returns a carry this method is used in the second version of the multiplication algorithms
this method is created only on a 64bit platform***
Definition at line 1072 of file ttmathuint_x86_64.h.
UInt<value_size>& ttmath::Int< value_size >::operator++ | ( | ) |
UInt<value_size> ttmath::Int< value_size >::operator++ | ( | int | ) |
Int<value_size> ttmath::Int< value_size >::operator- | ( | ) | const |
standard mathematical operators
an operator for changing the sign
it's not changing 'this' but the changed value will be returned
Definition at line 1660 of file ttmathint.h.
Referenced by ttmath::Int< exp >::operator-().
|
inherited |
standard mathematical operators
Definition at line 3755 of file ttmathuint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | const Int< value_size > & | p | ) |
the default assignment operator
Definition at line 771 of file ttmathint.h.
Referenced by ttmath::Int< exp >::Int(), and ttmath::Int< exp >::operator-().
Int<value_size>& ttmath::Int< value_size >::operator= | ( | const Int< argument_size > & | p | ) |
this operator converts an Int<another_size> type to this class
it doesn't return a carry
Definition at line 785 of file ttmathint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | sint | i | ) |
Int<value_size>& ttmath::Int< value_size >::operator= | ( | const UInt< argument_size > & | p | ) |
this operator converts an UInt<another_size> type to this class
it doesn't return a carry
Definition at line 840 of file ttmathint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | uint | i | ) |
Int<value_size>& ttmath::Int< value_size >::operator= | ( | unsigned int | i | ) |
this method converts 32 bit unsigned int type to this class this operator is created only on a 64bit platform***
Definition at line 1025 of file ttmathint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | signed int | i | ) |
this operator converts 32 bit signed int type to this class this operator is created only on a 64bit platform***
Definition at line 1047 of file ttmathint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | const char * | s | ) |
this operator converts a string into its value (with base = 10)
Definition at line 1481 of file ttmathint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | const wchar_t * | s | ) |
this operator converts a string into its value (with base = 10)
Definition at line 1505 of file ttmathint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | const std::wstring & | s | ) |
this operator converts a string into its value (with base = 10)
Definition at line 1516 of file ttmathint.h.
Int<value_size>& ttmath::Int< value_size >::operator= | ( | const std::string & | s | ) |
this operator converts a string into its value (with base = 10)
Definition at line 1529 of file ttmathint.h.
bool ttmath::Int< value_size >::operator== | ( | const Int< value_size > & | l | ) | const |
methods for comparing
Definition at line 1545 of file ttmathint.h.
|
inherited |
bitwise operators
Definition at line 3895 of file ttmathuint.h.
uint ttmath::Int< value_size >::Pow | ( | Int< value_size > | pow | ) |
power this = this ^ pow
return values:
Definition at line 608 of file ttmathint.h.
|
inherited |
power this = this ^ pow binary algorithm (r-to-l)
return values:
Definition at line 2425 of file ttmathuint.h.
Referenced by ttmath::Int< exp >::DivInt().
|
inherited |
this method is used when macro TTMATH_DEBUG_LOG is defined
Definition at line 159 of file ttmathuint.h.
|
inherited |
this method is used when macro TTMATH_DEBUG_LOG is defined
Definition at line 169 of file ttmathuint.h.
|
inherited |
some methods used for debugging purposes
this method is only for debugging purposes or when we want to make a table of a variable (constant) in ttmathbig.h
it prints the table in a nice form of several columns
Definition at line 97 of file ttmathuint.h.
|
staticinherited |
this method is used when macro TTMATH_DEBUG_LOG is defined
Definition at line 135 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::PrintLog(), and ttmath::UInt< man >::PrintVectorLog().
|
staticinherited |
this method is used when macro TTMATH_DEBUG_LOG is defined
Definition at line 148 of file ttmathuint.h.
|
inherited |
moving all bits into the left side 'bits' times return value <- this <- C
bits is from a range of <0, man * TTMATH_BITS_PER_UINT> or it can be even bigger then all bits will be set to 'c'
the value c will be set into the lowest bits and the method returns state of the last moved bit
Definition at line 460 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::CompensationToLeft(), ttmath::UInt< man >::Div1(), ttmath::UInt< man >::operator~(), ttmath::Big< exp, man >::RemainFraction(), and ttmath::Big< exp, man >::ToInt().
|
inherited |
moving all bits into the right side 'bits' times c -> this -> return value
bits is from a range of <0, man * TTMATH_BITS_PER_UINT> or it can be even bigger then all bits will be set to 'c'
the value c will be set into the highest bits and the method returns state of the last moved bit
Definition at line 555 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::BitAnd(), ttmath::Big< exp, man >::BitOr(), ttmath::Big< exp, man >::BitXor(), ttmath::Big< exp, man >::ChangeSign(), ttmath::Big< exp, man >::MulUInt(), ttmath::UInt< man >::operator~(), ttmath::Big< exp, man >::Pow(), ttmath::UInt< man >::Sqrt(), ttmath::Big< exp, man >::ToDouble(), and ttmath::Big< exp, man >::ToInt().
|
inherited |
setting the 'bit_index' bit and returning the last state of the bit
bit_index bigger or equal zero
Definition at line 726 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Div2().
|
staticinherited |
this method sets a special bit in the 'value' and returns the last state of the bit (zero or one)
this method is created only on a 64bit platform***
bit is from <0,63>
e.g. uint x = 100; uint bit = SetBitInWord(x, 3); now: x = 108 and bit = 0
Definition at line 1020 of file ttmathuint_x86_64.h.
|
inherited |
this method copies the value stored in an another table (warning: first values in temp_table are the highest words – it's different from our table)
this method is created only on a 64bit platform***
we copy as many words as it is possible
if temp_table_len is bigger than value_size we'll try to round the lowest word from table depending on the last not used bit in temp_table (this rounding isn't a perfect rounding – look at the description below)
and if temp_table_len is smaller than value_size we'll clear the rest words in the table
warning: we're using 'temp_table' as a pointer at 32bit words
Definition at line 325 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::SetE(), ttmath::Big< exp, man >::SetLn10(), ttmath::Big< exp, man >::SetLn2(), ttmath::UInt< man >::Swap(), and ttmath::Big< exp, man >::Swap().
void ttmath::Int< value_size >::SetMax | ( | ) |
this method sets the max value which this class can hold (all bits will be one besides the last one)
Definition at line 71 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::SetMax(), ttmath::Big< exp, man >::SetMin(), and ttmath::Int< exp >::ToWString().
void ttmath::Int< value_size >::SetMin | ( | ) |
this method sets the min value which this class can hold (all bits will be zero besides the last one which is one)
Definition at line 82 of file ttmathint.h.
Referenced by ttmath::Int< exp >::ToWString().
|
inherited |
this method sets one
Definition at line 202 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Div(), ttmath::Int< exp >::Pow(), and ttmath::UInt< man >::Pow().
void ttmath::Int< value_size >::SetSign | ( | ) |
this method sets the sign
samples
from a positive value we make a negative value, if the value is negative we do nothing
Definition at line 141 of file ttmathint.h.
Referenced by ttmath::Int< exp >::Div(), ttmath::Int< exp >::DivInt(), ttmath::Int< exp >::Mul(), and ttmath::Int< exp >::MulInt().
void ttmath::Int< value_size >::SetSignOne | ( | ) |
this method sets -1 as the value (-1 is equal the max value in an unsigned type)
Definition at line 93 of file ttmathint.h.
|
inherited |
this method sets zero
Definition at line 188 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::Big(), ttmath::Int< exp >::ChangeSign(), ttmath::UInt< man >::ClearFirstBits(), ttmath::UInt< man >::Div(), ttmath::UInt< man >::Div1(), ttmath::UInt< man >::Div2(), ttmath::UInt< man >::Div3(), ttmath::Big< exp, man >::Exp(), ttmath::UInt< man >::MulBig(), ttmath::UInt< man >::MulFastestBig(), ttmath::UInt< man >::MulInt(), ttmath::Int< exp >::SetMin(), ttmath::UInt< man >::SetMin(), ttmath::UInt< man >::SetOne(), ttmath::Big< exp, man >::SetOne(), ttmath::Big< exp, man >::SetZero(), ttmath::UInt< man >::Sqrt(), ttmath::Big< exp, man >::Standardizing(), ttmath::Big< exp, man >::ToInt(), and ttmath::UInt< man >::ToString().
|
inherited |
this method returns the size of the table
Definition at line 179 of file ttmathuint.h.
|
inherited |
square root e.g. Sqrt(9) = 3 ('digit-by-digit' algorithm)
Definition at line 2461 of file ttmathuint.h.
uint ttmath::Int< value_size >::Sub | ( | const Int< value_size > & | ss2 | ) |
this method subtracts two values with a sign
we don't use the previous Add because the method ChangeSign can sometimes return carry
this = p1(=this) - p2
Definition at line 299 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::Add(), ttmath::Big< exp, man >::BitAnd(), ttmath::Big< exp, man >::BitOr(), ttmath::Big< exp, man >::BitXor(), ttmath::Big< exp, man >::Mul(), ttmath::Int< exp >::operator-(), ttmath::Big< exp, man >::RemainFraction(), and ttmath::Big< exp, man >::Standardizing().
|
inherited |
this method's subtracting ss2 from the 'this' and subtracting carry if it has been defined (this = this - ss2 - c)
this method is created only on a 64bit platform***
c must be zero or one (might be a bigger value than 1) function returns carry (1) (if it was)
Definition at line 460 of file ttmathuint_x86_64.h.
Referenced by ttmath::Int< exp >::ChangeSign(), ttmath::UInt< man >::Div1(), ttmath::UInt< man >::operator-(), ttmath::UInt< man >::Sqrt(), and ttmath::Int< exp >::Sub().
uint ttmath::Int< value_size >::SubInt | ( | uint | value, |
uint | index = 0 |
||
) |
this method subtracts one unsigned word (at a specific position) and returns a carry (if it was)
Definition at line 314 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::FromBig().
uint ttmath::Int< value_size >::SubOne | ( | ) |
this method subtracts one from the value and returns carry
Definition at line 340 of file ttmathint.h.
Referenced by ttmath::Int< exp >::operator++(), ttmath::Big< exp, man >::PowUInt(), ttmath::Big< exp, man >::Set05(), and ttmath::Big< exp, man >::Sqrt().
|
staticinherited |
this static method subtractes one vector from the other 'ss1' is larger in size or equal to 'ss2'
result - is the result vector (which has size the same as ss1: ss1_size)
Example: ss1_size is 5, ss2_size is 3 ss1: ss2: result (output): 5 1 5-1 4 3 4-3 2 7 2-7 6 6-1 (the borrow from previous item) 9 9 return (carry): 0 of course the carry (borrow) is propagated and will be returned from the last item (this method is used by the Karatsuba multiplication algorithm)
Definition at line 597 of file ttmathuint_x86_64.h.
|
inherited |
this method swappes this for an argument
Definition at line 239 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::Swap().
sint ttmath::Int< value_size >::ToInt | ( | ) | const |
this method returns the lowest value from table with a sign
we must be sure when we using this method whether the value will hold in an sint type or not (the rest value from table must be zero or -1)
Definition at line 1132 of file ttmathint.h.
Referenced by ttmath::Big< exp, man >::Big(), ttmath::Big< exp, man >::BitAnd(), ttmath::Big< exp, man >::BitOr(), ttmath::Big< exp, man >::BitXor(), ttmath::Big< exp, man >::FromBig(), ttmath::Big< exp, man >::IsInteger(), ttmath::Big< exp, man >::Mod2(), ttmath::Big< exp, man >::RemainFraction(), ttmath::Big< exp, man >::SkipFraction(), ttmath::Big< exp, man >::ToDouble(), ttmath::Int< exp >::ToInt(), and ttmath::Big< exp, man >::ToInt().
uint ttmath::Int< value_size >::ToInt | ( | uint & | result | ) | const |
this method converts the value to uint type can return a carry if the value is too long to store it in uint type
Definition at line 1157 of file ttmathint.h.
uint ttmath::Int< value_size >::ToInt | ( | sint & | result | ) | const |
this method converts the value to sint type can return a carry if the value is too long to store it in sint type
Definition at line 1167 of file ttmathint.h.
uint ttmath::Int< value_size >::ToInt | ( | unsigned int & | result | ) | const |
this method converts the value to a 32 bit unsigned integer can return a carry if the value is too long to store it in this type this method is created only on a 64 bit platform ***
Definition at line 1274 of file ttmathint.h.
uint ttmath::Int< value_size >::ToInt | ( | int & | result | ) | const |
this method converts the value to a 32 bit signed integer can return a carry if the value is too long to store it in this type this method is created only on a 64 bit platform ***
Definition at line 1285 of file ttmathint.h.
void ttmath::Int< value_size >::ToString | ( | std::string & | result, |
uint | b = 10 |
||
) | const |
this method converts the value to a string with a base equal 'b'
Definition at line 1332 of file ttmathint.h.
Referenced by ttmath::Int< exp >::operator++().
std::string ttmath::Int< value_size >::ToString | ( | uint | b = 10 | ) | const |
this method converts the value to a string with a base equal 'b'
Definition at line 1341 of file ttmathint.h.
void ttmath::Int< value_size >::ToString | ( | std::wstring & | result, |
uint | b = 10 |
||
) | const |
this method converts the value to a string with a base equal 'b'
Definition at line 1355 of file ttmathint.h.
|
inherited |
an auxiliary method for converting to a string it's used from Int::ToString() too (negative is set true then)
Definition at line 3316 of file ttmathuint.h.
Referenced by ttmath::Int< exp >::ToInt(), and ttmath::UInt< man >::ToString().
|
protectedinherited |
an auxiliary method for converting into the string it returns the log (with the base 2) from x where x is in <2;16>
Definition at line 3281 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::ToStringBase().
uint ttmath::Int< value_size >::ToUInt | ( | uint & | result | ) | const |
this method converts the value to uint type can return a carry if the value is too long to store it in uint type
Definition at line 1142 of file ttmathint.h.
uint ttmath::Int< value_size >::ToUInt | ( | unsigned int & | result | ) | const |
this method converts the value to a 32 bit unsigned integer can return a carry if the value is too long to store it in this type this method is created only on a 64 bit platform ***
Definition at line 1258 of file ttmathint.h.
|
inherited |
this method returns the lowest value from table
we must be sure when we using this method whether the value will hold in an uint type or not (the rest value from the table must be zero)
Definition at line 3103 of file ttmathuint.h.
Referenced by ttmath::Big< exp, man >::Big(), ttmath::Int< exp >::ToInt(), ttmath::UInt< man >::ToInt(), and ttmath::Int< exp >::ToUInt().
std::wstring ttmath::Int< value_size >::ToWString | ( | uint | b = 10 | ) | const |
this method converts the value to a string with a base equal 'b'
Definition at line 1364 of file ttmathint.h.
|
friend |
output to standard streams
Definition at line 1837 of file ttmathint.h.
|
friend |
output to standard streams
Definition at line 1848 of file ttmathint.h.
|
friend |
input from standard streams
Definition at line 1901 of file ttmathint.h.
|
friend |
input from standard streams
Definition at line 1912 of file ttmathint.h.
|
inherited |
buffer for the integer value table[0] - the lowest word of the value
Definition at line 81 of file ttmathuint.h.
Referenced by ttmath::UInt< man >::Add(), ttmath::Big< exp, man >::Big(), ttmath::UInt< man >::BitAnd(), ttmath::UInt< man >::BitOr(), ttmath::UInt< man >::BitXor(), ttmath::UInt< man >::CmpBigger(), ttmath::UInt< man >::CmpBiggerEqual(), ttmath::UInt< man >::CmpEqual(), ttmath::UInt< man >::CmpSmaller(), ttmath::UInt< man >::CmpSmallerEqual(), ttmath::UInt< man >::Div3(), ttmath::Int< exp >::DivInt(), ttmath::Big< exp, man >::Exp(), ttmath::Big< exp, man >::FromBig(), ttmath::Big< exp, man >::FromDouble(), ttmath::Big< exp, man >::FromInt(), ttmath::Big< exp, man >::FromUInt(), ttmath::UInt< man >::FromUInt(), ttmath::Big< exp, man >::IsInteger(), ttmath::Big< exp, man >::Mul(), ttmath::UInt< man >::Mul1Big(), ttmath::UInt< man >::Mul2(), ttmath::UInt< man >::Mul2Big(), ttmath::UInt< man >::Mul3(), ttmath::UInt< man >::Mul3Big(), ttmath::UInt< man >::MulFastest(), ttmath::UInt< man >::MulFastestBig(), ttmath::Big< exp, man >::MulUInt(), ttmath::UInt< man >::operator=(), ttmath::Int< exp >::operator==(), ttmath::Int< exp >::Pow(), ttmath::Big< exp, man >::Pow(), ttmath::UInt< man >::Pow(), ttmath::Big< exp, man >::SetOne(), ttmath::UInt< man >::Sqrt(), ttmath::UInt< man >::Sub(), ttmath::UInt< man >::Swap(), ttmath::Big< exp, man >::ToDouble(), ttmath::Big< exp, man >::ToInt(), ttmath::UInt< man >::ToString(), and ttmath::UInt< man >::UInt().