changed: version of the library: 0.8.3 now

git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@120 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2009-04-06 16:34:19 +00:00
parent fca1bc1a33
commit d8b829f4c5
5 changed files with 1574 additions and 1570 deletions

520
CHANGELOG
View File

@ -1,258 +1,262 @@
Version 0.8.3 prerelease: Version 0.8.3 (2009.04.06):
* fixed: RclMoveAllWords() and RcrMoveAllWords() sometimes didn't return * fixed: RclMoveAllWords() and RcrMoveAllWords() sometimes didn't return
the proper carry, (when 'bits' was greater than or equal to 'value_size') the proper carry, (when 'bits' was greater than or equal to 'value_size')
this had impact on Rcl() and Rcr(), they also returned the wrong carry this had impact on Rcl() and Rcr(), they also returned the wrong carry
* fixed: UInt::Div() didn't return a correct result when the divisor was equal 1 * fixed: UInt::Div() didn't return a correct result when the divisor was equal 1
there was an error in UInt::DivInt() - when the divisor was 1 it returned there was an error in UInt::DivInt() - when the divisor was 1 it returned
zero and the carry was set zero and the carry was set
* fixed: there was a TTMATH_REREFENCE_ASSERT error in Big::PowUInt() caused by: start.Mul(start) * fixed: there was a TTMATH_REREFENCE_ASSERT error in Big::PowUInt() caused by: start.Mul(start)
* fixed: Big::Add incorrectly rounded 'this' when both exponents were equal * fixed: Big::Add incorrectly rounded 'this' when both exponents were equal
it caused that sometimes when adding a zero the result has changed it caused that sometimes when adding a zero the result has changed
this had impact among other things on FromString() method this had impact among other things on FromString() method
"0,8" had different binary representation from "0,80" "0,8" had different binary representation from "0,80"
* fixed: template Big::FromBig(const Big<another_exp, another_man> & another) * fixed: template Big::FromBig(const Big<another_exp, another_man> & another)
didn't correctly set the exponent (when the mantisses had different size - didn't correctly set the exponent (when the mantisses had different size -
when 'man' was different from 'another_man') when 'man' was different from 'another_man')
this had impact on operator= too this had impact on operator= too
sample: sample:
Big<2,3> a = 100; Big<2,3> a = 100;
Big<3,5> b; Big<3,5> b;
b = a; // b had a wrong value b = a; // b had a wrong value
* fixed: Big::Pow(const Big<exp, man> & pow) * fixed: Big::Pow(const Big<exp, man> & pow)
it's using PowInt() only when pow.exponent is in range (-man*TTMATH_BITS_PER_UINT; 0] it's using PowInt() only when pow.exponent is in range (-man*TTMATH_BITS_PER_UINT; 0]
previously the powering 'hung' on an input like this: "(1+ 1e-10000) ^ 10e100000000" previously the powering 'hung' on an input like this: "(1+ 1e-10000) ^ 10e100000000"
(there was 10e100000000 iterations in PowInt()) (there was 10e100000000 iterations in PowInt())
* fixed: in function DegToRad(const ValueType & x, ErrorCode * err = 0) it is better * fixed: in function DegToRad(const ValueType & x, ErrorCode * err = 0) it is better
to make division first and then mutliplication -- the result is more to make division first and then mutliplication -- the result is more
accurate especially when x is: 90,180,270 or 360 accurate especially when x is: 90,180,270 or 360
* fixed: the parser didn't correctly treat operators for changing the base * fixed: the parser didn't correctly treat operators for changing the base
(radix) -- operators '#' and '&', e.g.: (radix) -- operators '#' and '&', e.g.:
'#sin(1)' was equal '0' -- there was a zero from '#' and then '#sin(1)' was equal '0' -- there was a zero from '#' and then
it was multipied by 'sin(1)' it was multipied by 'sin(1)'
the parser didn't check whether Big::FromString() has actually the parser didn't check whether Big::FromString() has actually
read a proper value -- the method Big::FromString() didn't have read a proper value -- the method Big::FromString() didn't have
something to report such a situation something to report such a situation
* fixed: Big::FromString() when the base is 10, the method reads the scientific * fixed: Big::FromString() when the base is 10, the method reads the scientific
part only if such a part it correctly supplied, e.g: part only if such a part it correctly supplied, e.g:
'1234e10', '1234e+10', '1234e-5' '1234e10', '1234e+10', '1234e-5'
previous '1234e' was treated as: '1234e0' (now parsing stops on 'e' and previous '1234e' was treated as: '1234e0' (now parsing stops on 'e' and
the 'e' can be parsed by other parsers, e.g. the mathematical the 'e' can be parsed by other parsers, e.g. the mathematical
parser -- now in the parser would be: '1234e' = '1234 * e' = '3354,3597...' ) parser -- now in the parser would be: '1234e' = '1234 * e' = '3354,3597...' )
* changed: UInt::FromString, added a parametr 'after_source' * changed: renamed: Big::PowUInt(UInt<pow_size> pow) -> Big::Pow(UInt<pow_size> pow)
which is pointing at the end of the parsing string it returns 2 when there is: 0^0
* changed: renamed: Big::PowUInt(UInt<pow_size> pow) -> Big::Pow(UInt<pow_size> pow) * changed: renamed: Big::PowInt(Int<pow_size> pow) -> Big::Pow(Int<pow_size> pow)
it returns 2 when there is: 0^0 it returns 2 when there is: 0^0 or 0^(-something)
* changed: renamed: Big::PowInt(Int<pow_size> pow) -> Big::Pow(Int<pow_size> pow) * changed: renamed: Big::PowBUInt() -> PowUInt(), Big::PowBInt() -> Big::PowInt()
it returns 2 when there is: 0^0 or 0^(-something) they return 2 when the arguments are incorrect (like above)
* changed: renamed: Big::PowBUInt() -> PowUInt(), Big::PowBInt() -> Big::PowInt() * changed: UInt::SetBitInWord(uint & value, uint bit) is taking the first argument by a reference now,
they return 2 when the arguments are incorrect (like above) the specific bit is set in the 'value' and the method returns the last state of the bit (zero or one)
* changed: UInt::SetBitInWord(uint & value, uint bit) is taking the first argument by a reference now, * changed: UInt::SetBit(uint bit_index) - it's using TTMATH_ASSERT now
the specific bit is set in the 'value' and the method returns the last state of the bit (zero or one) * changed: the size of built-in variables (constants) in ttmathbig.h
* changed: UInt::SetBit(uint bit_index) - it's using TTMATH_ASSERT now now they consist of 256 32bit words
* changed: the size of built-in variables (constants) in ttmathbig.h macro TTMATH_BUILTIN_VARIABLES_SIZE is equal: 256u on a 32bit platform and 128ul on a 64bit platform
now they consist of 256 32bit words * changed: the asm code in ttmathuint.h and ttmathuint64.h has been completely rewritten
macro TTMATH_BUILTIN_VARIABLES_SIZE is equal: 256u on a 32bit platform and 128ul on a 64bit platform now UInt<> is faster about 15-30% than UInt<> from 0.8.2
* changed: the asm code in ttmathuint.h and ttmathuint64.h has been completely rewritten (much faster now) this has impact on Big<> too - it's faster about 10% now
* changed: in the parser: the form with operators '#' and '&' is as follows: * changed: in the parser: the form with operators '#' and '&' is as follows:
[-|+][#|&]numeric_value [-|+][#|&]numeric_value
previous was: [-|+][#|&][-|+]numeric_value previous was: [-|+][#|&][-|+]numeric_value
* changed: in the parser: the short form of multiplication has the same * changed: in the parser: the short form of multiplication has the same
priority as the normal multiplication, e.g.: priority as the normal multiplication, e.g.:
'2x^3' = 2 * (x^3) '2x^3' = 2 * (x^3)
previous the priority was greater than powering priority previous the priority was greater than powering priority
previous: '2x^3' = (2*x) ^ 3 previous: '2x^3' = (2*x) ^ 3
* added: UInt::GetBit(uint bit_index) - returning the state of the specific bit * added: UInt::GetBit(uint bit_index) - returning the state of the specific bit
* added: Big::operator=(double) and Big::Big(double) * added: Big::operator=(double) and Big::Big(double)
* added: UInt::Pow(UInt<value_size> pow) and Int::Pow(Int<value_size> pow) * added: UInt::Pow(UInt<value_size> pow) and Int::Pow(Int<value_size> pow)
* added: global template functions in ttmath.h: * added: global template functions in ttmath.h:
ValueType GradToRad(const ValueType & x, ErrorCode * err = 0) ValueType GradToRad(const ValueType & x, ErrorCode * err = 0)
ValueType RadToGrad(const ValueType & x, ErrorCode * err = 0) ValueType RadToGrad(const ValueType & x, ErrorCode * err = 0)
ValueType DegToGrad(const ValueType & x, ErrorCode * err = 0) ValueType DegToGrad(const ValueType & x, ErrorCode * err = 0)
ValueType DegToGrad(const ValueType & d, const ValueType & m, ValueType DegToGrad(const ValueType & d, const ValueType & m,
const ValueType & s, ErrorCode * err = 0) const ValueType & s, ErrorCode * err = 0)
ValueType GradToDeg(const ValueType & x, ErrorCode * err = 0) ValueType GradToDeg(const ValueType & x, ErrorCode * err = 0)
* added: Parser::SetDegRadGrad(int angle) - 0 deg, 1 rad (default), 2 grad * added: Parser::SetDegRadGrad(int angle) - 0 deg, 1 rad (default), 2 grad
this affects following functions (in the parser only): sin, cos, tan, cot, this affects following functions (in the parser only): sin, cos, tan, cot,
asin, acos, atan, acot asin, acos, atan, acot
* added: functions to the parser: gradtorad(grad), radtograd(rad), degtograd(deg), * added: functions to the parser: gradtorad(grad), radtograd(rad), degtograd(deg),
degtograd(d,m,s), gradtodeg(grad) degtograd(d,m,s), gradtodeg(grad)
* added: to Int::FromString(): parameter 'const char ** after_source = 0' * added: UInt::FromString, added a parametr 'after_source'
if exists it's pointing at the end of the parsed string which is pointing at the end of the parsed string
* added: to UInt::FromString(), Int::FromString(), Big::FromString(): * added: Int::FromString(): parameter 'const char ** after_source = 0'
parameter 'bool * value_read = 0' - (if exists) tells if exists it's pointing at the end of the parsed string
whether something has actually been read (at least one digit) * added: to UInt::FromString(), Int::FromString(), Big::FromString():
* removed: Big::FromString() this method doesn't longer recognize operators parameter 'bool * value_read = 0' - (if exists) tells
for changing the base ('#' and '&') whether something has actually been read (at least one digit)
* added: Objects::IsDefined(const std::string & name)
returning true if such an object is defined
Version 0.8.2 (2008.06.18): * removed: Big::FromString() this method doesn't longer recognize operators
* added: UInt::BitNot2() this method has been proposed by for changing the base ('#' and '&')
Arek <kmicicc AnTispam users.sourceforge.net>
* changed: Int::FromInt(const Int<argument_size> & p),
Int::FromInt(sint value) (it returns zero now) Version 0.8.2 (2008.06.18):
Int::operator=(uint i) * added: UInt::BitNot2() this method has been proposed by
Int::Int(uint i) Arek <kmicicc AnTispam users.sourceforge.net>
* added: Int::FromUInt(const UInt<argument_size> & p), * changed: Int::FromInt(const Int<argument_size> & p),
Int::FromUInt(uint value) Int::FromInt(sint value) (it returns zero now)
and appropriate constructors and assignment Int::operator=(uint i)
operators as well Int::Int(uint i)
* changed: Big::FromInt(Int<int_size> value), * added: Int::FromUInt(const UInt<argument_size> & p),
* added: Big::FromUInt(UInt<int_size> value), Int::FromUInt(uint value)
Big::operator=(const UInt<int_size> & value) and appropriate constructors and assignment
Big::Big(const UInt<int_size> & value) operators as well
* changed: the parser is allowed to recognize values which * changed: Big::FromInt(Int<int_size> value),
begin with a dot, e.g '.5' is treated as '0.5' * added: Big::FromUInt(UInt<int_size> value),
* added: a method Big::FromDouble(double) which converts from Big::operator=(const UInt<int_size> & value)
standard double into a Big Big::Big(const UInt<int_size> & value)
* added: uint Big::ToDouble(double&) - converting into double * changed: the parser is allowed to recognize values which
* added: Big::FromBig() and an operator= and a contructor begin with a dot, e.g '.5' is treated as '0.5'
for converting from another kind of a Big class * added: a method Big::FromDouble(double) which converts from
* added: to the parser: avg(), sum() standard double into a Big
* added: 'decimal_point' parameter into Big::ToString(...) * added: uint Big::ToDouble(double&) - converting into double
* fixed: Big::operator>> didn't use TTMATH_COMMA_CHARACTER_2 macro * added: Big::FromBig() and an operator= and a contructor
* added: a short form of multiplication (without the '*' character) for converting from another kind of a Big class
e.g. '5y', (it's used only if the second parameter * added: to the parser: avg(), sum()
is a variable or function) * added: 'decimal_point' parameter into Big::ToString(...)
* changed: variables and functions are case-sensitive now * fixed: Big::operator>> didn't use TTMATH_COMMA_CHARACTER_2 macro
* added: variables and functions can have underline characters * added: a short form of multiplication (without the '*' character)
in their names e.g. '5y', (it's used only if the second parameter
* changed: 'max_digit_after_comma' in Big::ToString() is a variable or function)
remove the -2 state * changed: variables and functions are case-sensitive now
* added: 'remove_trailing_zeroes' in Big::ToString() * added: variables and functions can have underline characters
it's either true or false in their names
* fixed/changed: the way of using Big::SetSign() * changed: 'max_digit_after_comma' in Big::ToString()
the method do not check whether there is a zero or not now remove the -2 state
(even if there's a zero the method can set a sign bit) * added: 'remove_trailing_zeroes' in Big::ToString()
I changed this due to some prior errors it's either true or false
(errors corrected in revision 17, 49 and 58) * fixed/changed: the way of using Big::SetSign()
the method do not check whether there is a zero or not now
(even if there's a zero the method can set a sign bit)
Version 0.8.1 (2007.04.17): I changed this due to some prior errors
* fixed: Big::PowFrac(..) didn't return a correct error code (errors corrected in revision 17, 49 and 58)
(when 'this' was negative)
* added: Root(x; index) (and to the parser as well)
* added: macro: TTMATH_PRERELEASE_VER (can be either zero or one) Version 0.8.1 (2007.04.17):
* added: UInt::MulInt(int, UInt<int another_size>::&) * fixed: Big::PowFrac(..) didn't return a correct error code
* added: Big::MulUInt(uint) (when 'this' was negative)
* changed: Big::MulInt(sint) * added: Root(x; index) (and to the parser as well)
* added: Big::ToUInt(uint &) * added: macro: TTMATH_PRERELEASE_VER (can be either zero or one)
* changed: Big::ToInt(sint&) * added: UInt::MulInt(int, UInt<int another_size>::&)
* changed: Factorial() it uses Big::MulUInt() at the beginning * added: Big::MulUInt(uint)
(faster now especially more on a 32bit platform) * changed: Big::MulInt(sint)
* added: doxygen.cfg for generating a documentation from the doxygen * added: Big::ToUInt(uint &)
* changed: UInt::Rcl(uint c=0) and UInt::Rcr(uint c=0) into * changed: Big::ToInt(sint&)
UInt::Rcl2(uint bits, uint c) and UInt::Rcr2(uint bits, uint c) * changed: Factorial() it uses Big::MulUInt() at the beginning
now they can move more than one bit and they are only private (faster now especially more on a 32bit platform)
* fixed: UInt::Rcl(uint bits, uint c) and UInt::Rcr(uint bits, uint c) * added: doxygen.cfg for generating a documentation from the doxygen
didn't correctly return a carry if the 'bits' were equal * changed: UInt::Rcl(uint c=0) and UInt::Rcr(uint c=0) into
to 'value_size*TTMATH_BITS_PER_UINT' UInt::Rcl2(uint bits, uint c) and UInt::Rcr2(uint bits, uint c)
* changed: UInt::Rcl(uint bits, uint c) and UInt::Rcr(uint bits, uint c) now they can move more than one bit and they are only private
into UInt::Rcl(uint bits, uint c=0) and * fixed: UInt::Rcl(uint bits, uint c) and UInt::Rcr(uint bits, uint c)
UInt::Rcr(uint bits, uint c=0) didn't correctly return a carry if the 'bits' were equal
they are faster now when the bits is greater than a half of to 'value_size*TTMATH_BITS_PER_UINT'
the TTMATH_BITS_PER_UINT * changed: UInt::Rcl(uint bits, uint c) and UInt::Rcr(uint bits, uint c)
* changed: UInt::CompensationToLeft() it's faster now into UInt::Rcl(uint bits, uint c=0) and
* changed: more small changes where there were UInt::Rcl(uint c=0) and UInt::Rcr(uint bits, uint c=0)
UInt::Rcr(uint c=0) used they are faster now when the bits is greater than a half of
* changed: as the Big type uses UInt::Rcl() and UInt::Rcr() a lot then the TTMATH_BITS_PER_UINT
it is much faster now (about 5-25%) * changed: UInt::CompensationToLeft() it's faster now
* added: ASinh(), ACosh(), ATanh() /ATgh()/, ACoth() /ACtgh()/ * changed: more small changes where there were UInt::Rcl(uint c=0) and
and to the parser as well UInt::Rcr(uint c=0) used
* added: UInt::BitAnd(), UInt::BitOr(), UInt::BitXor(), UInt::BitNot(), * changed: as the Big type uses UInt::Rcl() and UInt::Rcr() a lot then
Big::BitAnd(), Big::BitOr(), Big::BitXor() it is much faster now (about 5-25%)
* added: to the parser: bitand(), bitor(), bitxor() * added: ASinh(), ACosh(), ATanh() /ATgh()/, ACoth() /ACtgh()/
/band(), bor(), bxor()/ and to the parser as well
* changed: the way of parsing operators in the mathematical parser * added: UInt::BitAnd(), UInt::BitOr(), UInt::BitXor(), UInt::BitNot(),
(the parser is not too much greedy now) Big::BitAnd(), Big::BitOr(), Big::BitXor()
* added: to the parser: bitand(), bitor(), bitxor()
/band(), bor(), bxor()/
Version 0.8.0 (2007.03.28): * changed: the way of parsing operators in the mathematical parser
* added: into the parser: SetFactorialMax() (the parser is not too much greedy now)
* added: DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/ Version 0.8.0 (2007.03.28):
* changed: class Objects in ttmathobjects.h has been completely rewritten, * added: into the parser: SetFactorialMax()
we can change the names of user-defined variables or functions, * added: DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
and the names are case-sensitive now RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
* added: class History which is used in functions which take a lot of time Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
during calculating e.g. Factorial(x) * changed: class Objects in ttmathobjects.h has been completely rewritten,
* added: Tg(x) a wrapper for Tan(x) we can change the names of user-defined variables or functions,
* changed: CTan(x) is Cot(x) now and the names are case-sensitive now
* added: Ctg(x) a wrapper for Cot(x) * added: class History which is used in functions which take a lot of time
* added: ATg(x) a wrapper for ATan(x) during calculating e.g. Factorial(x)
* changed: ACTan(x) is ACot(x) now * added: Tg(x) a wrapper for Tan(x)
* added: ACtg(x) a wrapper for ACot(x) * changed: CTan(x) is Cot(x) now
* added: UInt::PrintTable() (for debugging etc.) * added: Ctg(x) a wrapper for Cot(x)
* changed: the methods Big::SetPi() Big::SetE() and Big::SetLn2() have * added: ATg(x) a wrapper for ATan(x)
been rewritten, now they have 128 32bit words (it's about * changed: ACTan(x) is ACot(x) now
1232 valid decimal digits) * added: ACtg(x) a wrapper for ACot(x)
* fixed: previous values from Big::SetPi() Big::SetE() and * added: UInt::PrintTable() (for debugging etc.)
Big::SetLn2() were not too much accurate (last 2-3 words were wrong) * changed: the methods Big::SetPi() Big::SetE() and Big::SetLn2() have
* added: Big::SetLn10() (128 32bit words as well) been rewritten, now they have 128 32bit words (it's about
* added: macro TTMATH_BUILTIN_VARIABLES_SIZE which is equal 128u on 1232 valid decimal digits)
32bit platforms and 64ul on 64bit platforms (128/2=64) * fixed: previous values from Big::SetPi() Big::SetE() and
* added: macros TTMATH_PLATFORM32 and TTMATH_PLATFORM64 Big::SetLn2() were not too much accurate (last 2-3 words were wrong)
* changed: a small optimisation in UInt::Mul2Big() * added: Big::SetLn10() (128 32bit words as well)
* added: at the end of ttmath.h: #include "ttmathparser.h" * added: macro TTMATH_BUILTIN_VARIABLES_SIZE which is equal 128u on
this is for convenience for a programmer, he can only use #include 32bit platforms and 64ul on 64bit platforms (128/2=64)
with ttmath.h even if he uses the parser * added: macros TTMATH_PLATFORM32 and TTMATH_PLATFORM64
* added: to samples: big.cpp, parser.cpp * changed: a small optimisation in UInt::Mul2Big()
* added/changes/fixed: in copy-constructors and operators= in Int, * added: at the end of ttmath.h: #include "ttmathparser.h"
Uint and Big (more info in the commit log) this is for convenience for a programmer, he can only use #include
* renamed: Big::SetDotOne() into Big::Set05() with ttmath.h even if he uses the parser
* changes: a few small optimisations in Big * added: to samples: big.cpp, parser.cpp
* deleted: the word 'virtual' from destructors: UInt, Int, Big * added/changes/fixed: in copy-constructors and operators= in Int,
(types in this library are not projected to be base-classes for Uint and Big (more info in the commit log)
another ones derived from them) * renamed: Big::SetDotOne() into Big::Set05()
* and more small changes (look at the commit log) * changes: a few small optimisations in Big
* deleted: the word 'virtual' from destructors: UInt, Int, Big
(types in this library are not projected to be base-classes for
Version 0.7.2 (2007.03.09): another ones derived from them)
* added: Big::Mod - the remainder from a division * and more small changes (look at the commit log)
* added: Big::Sgn - the 'sign' from the value (-1,0,1)
* added: global functions Mod and Sgn too
* added: checking whether a user gives a correct value of a variable or function Version 0.7.2 (2007.03.09):
(user-defined variables/functions in the mathematical parser) * added: Big::Mod - the remainder from a division
* added: into the parser: logical operators: > < >= <= == != && || * added: Big::Sgn - the 'sign' from the value (-1,0,1)
* added: into the parser: logical functions: and() or() not() if() * added: global functions Mod and Sgn too
* added: ErrorCode::err_unknown_operator when the parser couldn't read an operator * added: checking whether a user gives a correct value of a variable or function
(user-defined variables/functions in the mathematical parser)
* added: into the parser: logical operators: > < >= <= == != && ||
Version 0.7.1 (2007.02.27): * added: into the parser: logical functions: and() or() not() if()
* fixed: the error 'overflow during printing' which was caused * added: ErrorCode::err_unknown_operator when the parser couldn't read an operator
by Big::FromInt(Int<int_size> value) (the sign has to be set at the end)
* fixed: many small errors
* added: ATan (arctan), ACTan (arc ctan) functions Version 0.7.1 (2007.02.27):
* fixed: the error 'overflow during printing' which was caused
by Big::FromInt(Int<int_size> value) (the sign has to be set at the end)
Version 0.7.0 (2007.02.24): * fixed: many small errors
* finished: support for 64bit platforms * added: ATan (arctan), ACTan (arc ctan) functions
* added: ASin (arcsin), ACos (arccos) functions
Version 0.7.0 (2007.02.24):
Version 0.6.4 (2007.01.29): * finished: support for 64bit platforms
* fixed: the problem with a sign in the mathematical parser /-(1) was 1/ * added: ASin (arcsin), ACos (arccos) functions
* added: UInt::AddInt and UInt::SubInt
* changed: UInt::AddOne and UInt::SubOne (much faster now)
* added: UInt::SetBitInWord Version 0.6.4 (2007.01.29):
* changed: UInt::SetBit (much faster now) * fixed: the problem with a sign in the mathematical parser /-(1) was 1/
UInt::AddTwoUints renamed to UInt::AddTwoInts * added: UInt::AddInt and UInt::SubInt
UInt::FindLeadingBit32 renamed to UInt::FindLeadingBitInWord * changed: UInt::AddOne and UInt::SubOne (much faster now)
UInt::Mul64 renamed to UInt::MulTwoWords * added: UInt::SetBitInWord
UInt::Div64 renamed to UInt::DivTwoWords * changed: UInt::SetBit (much faster now)
* added: UInt::SetBitInWord UInt::AddTwoUints renamed to UInt::AddTwoInts
* and more small changes in UInt type UInt::FindLeadingBit32 renamed to UInt::FindLeadingBitInWord
* start adding support for Amd64 (not finished yet) (added ttmathuint64.h) UInt::Mul64 renamed to UInt::MulTwoWords
UInt::Div64 renamed to UInt::DivTwoWords
* added: UInt::SetBitInWord
Version 0.6.3 (2007.01.22): * and more small changes in UInt type
* changed: position of arguments (x and base) in logarithm functions are swapped * start adding support for Amd64 (not finished yet) (added ttmathuint64.h)
* changed: it's possible to use any multiplication algorithms in the same time
(macros UINT_MUL_VERSION_'X' have gone)
* added: ExceptionInfo, ReferenceError and RuntimeError classes Version 0.6.3 (2007.01.22):
* changed: the mess in macros has been cleaned up * changed: position of arguments (x and base) in logarithm functions are swapped
* added: TTMATH_RELEASE macro * changed: it's possible to use any multiplication algorithms in the same time
(macros UINT_MUL_VERSION_'X' have gone)
* added: ExceptionInfo, ReferenceError and RuntimeError classes
Version 0.6.2 (2007.01.10): * changed: the mess in macros has been cleaned up
* added: New division algorithm (radix b) where b is 2^32 * added: TTMATH_RELEASE macro
Version 0.6.2 (2007.01.10):
* added: New division algorithm (radix b) where b is 2^32

View File

@ -1,28 +1,28 @@
Copyright (c) 2006-2009, Tomasz Sowa Copyright (c) 2006-2009, Tomasz Sowa
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, * Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
* Neither the name Tomasz Sowa nor the names of contributors to this * Neither the name Tomasz Sowa nor the names of contributors to this
project may be used to endorse or promote products derived project may be used to endorse or promote products derived
from this software without specific prior written permission. from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE. THE POSSIBILITY OF SUCH DAMAGE.

52
README
View File

@ -1,26 +1,26 @@
TTMath - a bignum library for C++ TTMath - a bignum library for C++
TTMath is a small library which allows one to perform arithmetic operations TTMath is a small library which allows one to perform arithmetic operations
with big unsigned integer, big signed integer and big floating point with big unsigned integer, big signed integer and big floating point
numbers. It provides standard mathematical operations like adding, numbers. It provides standard mathematical operations like adding,
subtracting, multiplying, dividing etc. With the library also goes subtracting, multiplying, dividing etc. With the library also goes
a mathematical parser which helps you solving input formulas read directly a mathematical parser which helps you solving input formulas read directly
from a user. from a user.
TTMath is developed under the BSD licence which means that it is free TTMath is developed under the BSD licence which means that it is free
for both personal and commercial use. for both personal and commercial use.
The library has some technical limitations: The library has some technical limitations:
* there are only two platforms that are supported: x86 and x86_64, * there are only two platforms that are supported: x86 and x86_64,
* you can use this library only with the C++ programming language. * you can use this library only with the C++ programming language.
The main goal of the library is to allow one to use big values in the same The main goal of the library is to allow one to use big values in the same
way as the standard types like int, float, etc. It does not need to be way as the standard types like int, float, etc. It does not need to be
compiled first because the whole library is written as the C++ templates. compiled first because the whole library is written as the C++ templates.
This means only C++ developers can use this library and one thing they have This means only C++ developers can use this library and one thing they have
to do is to use 'include' directive of the preprocessor. How big the to do is to use 'include' directive of the preprocessor. How big the
values can be is set directly in the source code by the programmer. values can be is set directly in the source code by the programmer.
Author: Tomasz Sowa <t.sowa@slimaczek.pl> Author: Tomasz Sowa <t.sowa@slimaczek.pl>
Project pages: http://ttmath.slimaczek.pl Project pages: http://ttmath.slimaczek.pl
http://sourceforge.net/projects/ttmath http://sourceforge.net/projects/ttmath

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@
#define TTMATH_MAJOR_VER 0 #define TTMATH_MAJOR_VER 0
#define TTMATH_MINOR_VER 8 #define TTMATH_MINOR_VER 8
#define TTMATH_REVISION_VER 3 #define TTMATH_REVISION_VER 3
#define TTMATH_PRERELEASE_VER 1 #define TTMATH_PRERELEASE_VER 0
/*! /*!