UInt::Pow(UInt<value_size> pow)
Big::Pow(UInt<pow_size> pow)
Big::PowUInt(Big<exp, man> pow)
when 'pow' was sufficient large the algorithm returned carry
but the result could have been calculated correctly
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@213 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: small optimization in ToInt(Int<int_size> & result)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@210 e52654a7-88a9-db11-a3e9-0013d4bc506e
this method returns true is something was calculated
(at least one mathematical operator was used or a function or variable)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@207 e52654a7-88a9-db11-a3e9-0013d4bc506e
it was broken (it lacks the case when either 'this' or 'ss2' is zero)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@206 e52654a7-88a9-db11-a3e9-0013d4bc506e
equal 1 (should be set 2)
this affected only no-asm parts - when macro TTMATH_NOASM was defined
fixed: UInt<value_size>::MulInt(uint ss2)
there was a buffer overflow when value_size was equal 1
fixed: UInt::AddVector() and UInt::SubVector() didn't want to compile
when macro TTMATH_NOASM was defined
added: macros:
TTMATH_LOGC(msg, carry)
TTMATH_VECTOR_LOG(msg, vector, len)
TTMATH_VECTOR_LOGC(msg, carry, vector, len)
added: UInt::PrintVectorLog() for debugging purposes
changed: UInt<> class uses new log macros
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@203 e52654a7-88a9-db11-a3e9-0013d4bc506e
(asm for x86_64 on MS VC)
changed: removed some MS VC warnings
changed: if TTMATH_DEBUG_LOG is defined then UInt::UInt()
constructor fills the table with special values
added: macro: TTMATH_BITS(min_bits)
which returns the number of machine words
capable to hold min_bits bits
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@201 e52654a7-88a9-db11-a3e9-0013d4bc506e
some warnings were raported by GCC
(uninitialized variable)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@200 e52654a7-88a9-db11-a3e9-0013d4bc506e
didn't want to compile
moved: UInt<>::SkipWhiteCharacters() to Misc::SkipWhiteCharacters()
UInt<>::CharToDigit() to Misc::CharToDigit()
UInt<>::DigitToChar() to Misc::DigitToChar()
removed: Parser::CharToDigit() - was duplicated (it's the same as Misc::CharToDigit())
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@198 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: wide characters can be used simultaneously with ascii characters
now we have two kind of methods: one for ascii characters and the other for wide characters
e.g.
void UInt::ToString(std::string & result)
void UInt::ToString(std::wstring & result)
previous was only one:
void UInt::ToString(tt_string & result)
and the 'tt_string' was a typedef to either std::string or std::wstring
and it was a little misleading to a user (he has to know what the tt_string is)
added: file: ttmathmisc.h some useful functions
changed: classes: ExceptionInfo, ReferenceError and RuntimeError are used only with ascii characters
removed: macros: TTMATH_USE_WCHAR, TTMATH_TEXT()
removed: typedefs: tt_char, tt_string, tt_ostringstream, tt_ostream, tt_istream
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@193 e52654a7-88a9-db11-a3e9-0013d4bc506e
uint __fastcall ttmath_subvector_x64(const uint * ss1, const uint * ss2, uint ss1_size, uint ss2_size, uint * result);
asm code for AddVector() and SubVector() for MS VC x86_64
changed: added prefixes "ttmath_" to all public procedures from ttmathuint_x86_64_msvc.asm
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@192 e52654a7-88a9-db11-a3e9-0013d4bc506e
if this flag is set then there is a value zero
added: Big::ClearInfoBit(unsigned char)
Big::SetInfoBit(unsigned char)
Big::IsInfoBit(unsigned char)
some methods for manipulating the info flags
changed: IsZero() is using TTMATH_BIG_ZERO flag
now it has O(1) complexity
previously was O(n)
changed: optimized some methods
they are using IsZero() for testing at the beginning
because this method is much faster now
changed: Big::Div(ss2)
Big::Mod(ss2)
they return 2 when ss2 is zero
previously returned 1
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@190 e52654a7-88a9-db11-a3e9-0013d4bc506e
(there was used ttmath::Abs() function which is unknown in Big<> class)
AboutEqual() returned true for: "2345.5" and "-2345.5" (the sign was not checked)
renamed: Big::AboutEqual() to Big::AboutEqualWithoutSign()
added: Big::AboutEqual()
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@189 e52654a7-88a9-db11-a3e9-0013d4bc506e
file: ttmathuint_x86_64_msvc.asm from chk branch (original was: ttmathuint_x86_amd64_msvc.asm)
(this file should be compiled first because MS VC doesn't support inline assembler in x86_64 mode)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@187 e52654a7-88a9-db11-a3e9-0013d4bc506e
deleted: properties svn:mime-type from ttmath.h
(it was for testing viewvc)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@186 e52654a7-88a9-db11-a3e9-0013d4bc506e
in single thread environment
the previous version of the method didn't store
the calculated logarithms
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@184 e52654a7-88a9-db11-a3e9-0013d4bc506e
you should compile with TTMATH_MULTITHREADS
and use TTMATH_MULTITHREADS_HELPER macro somewhere in your *.cpp file
added file: ttmaththreads.h (look there for more info)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@183 e52654a7-88a9-db11-a3e9-0013d4bc506e
* added: gamma() function to the parser
* added: Big::IsInteger() method
returns true if the value is integer
* added: CGamma<ValueType> class
is used with Gamma() and Factorial() in multithreaded environment
* changed: Factorial() is using the Gamma() function now
* removed: Parser<>::SetFactorialMax() method
the factorial() is such a fast now that we don't need the method longer
* removed: ErrorCode::err_too_big_factorial
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@178 e52654a7-88a9-db11-a3e9-0013d4bc506e
wide characters are used when macro TTMATH_USE_WCHAR is defined
this macro is defined automatically when there is macro UNICODE or _UNICODE defined
some types have been changed
char -> tt_char
std::string -> tt_string
std::ostringstream -> tt_ostringstream
std::ostream -> tt_ostream
std::istream -> tt_istream
normally tt_char is equal char but when you are using wide characters then tt_char will be wchar_t (and so on)
(all typedef's are in ttmathtypes.h)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@177 e52654a7-88a9-db11-a3e9-0013d4bc506e
fixed: some methods should set 'err_improper_argument' when the argument is a NaN object
(was: err_overflow)
changed: version of the library: 0.8.5 now
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@163 e52654a7-88a9-db11-a3e9-0013d4bc506e
the remainder from a division '%' was changed with a bitwise And operation '&'
((i % 5) == 0) was changed to: ((i & 3) == 0) - it means ((i % 4) == 0)
now the test if performed after 4 iterations (early were after 5 iterations)
we can do that when the divisor is a power of 2
changed: optimization in Factorial()
we're testing WasStopSignal() only after a few iterations
it's faster now about 4 times on GCC 4.3.3 (when stop object is provided to the factorial)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@161 e52654a7-88a9-db11-a3e9-0013d4bc506e
we can copy 'old_value = *this' only when 'testing' is true
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@160 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: some cosmetic changes to get rid of warnings generated by
MS Visual 2008 when warning level is 4
changed: names of labels in asm code: p to ttmath_loop, end to ttmath_end
p2 to ttmath_loop2
Robert Muir reported that there was a confict with boost::end
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@156 e52654a7-88a9-db11-a3e9-0013d4bc506e
bool Big::IsNan() - returns true if the NaN flag is set
void Big::SetNan() - sets the NaN flag
The NaN flag is set by default after creating an object:
Big<1, 2> a; // NaN is set (it means the object has not a valid number)
std::cout << a; // cout gives "NaN"
a = 123; // now NaN is not set
std::cout << a; // cout gives "123"
The NaN is set if there was a carry during calculations
a.Mul(very_big_value); // a will have a NaN set
The NaN is set if an argument is NaN too
b.SetNan();
a.Add(b); // a will have NaN because b has NaN too
If you try to do something on a NaN object, the result is a NaN too
a.SetNan();
a.Add(2); // a is still a NaN
The NaN is set if you use incorrect arguments
a.Ln(-10); // a will have the NaN flag
The only way to clear the NaN flag is to assign a correct value or other correct object
supposing 'a' has NaN flag, to remove the flag you can either:
a = 10;
a.FromInt(30);
a.SetOne();
a.FromBig(other_object_without_nan);
etc.
changed: renamed macro CONSTANTSGENERATOR to TTMATH_CONSTANTSGENERATOR
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@152 e52654a7-88a9-db11-a3e9-0013d4bc506e
void UInt::Mul3Big(const UInt<value_size> & ss2, UInt<value_size*2> & result)
a new multiplication algorithm: Karatsuba multiplication,
on a vector UInt<100> with all items different from zero this algorithm is faster
about 3 times than Mul2Big(), and on a vector UInt<1000> with all items different from
zero this algorithm is faster more than 5 times than Mul2Big()
(measured on 32bit platform with GCC 4.3.3 with -O3 and -DTTMATH_RELEASE)
added: uint MulFastest(const UInt<value_size> & ss2)
void MulFastestBig(const UInt<value_size> & ss2, UInt<value_size*2> & result)
those methods are trying to select the fastest multiplication algorithm
changed: 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)
those methods by default use MulFastest() and MulFastestBig()
changed: changed a little Mul2Big() to cooperate with Mul3Big()
changed: names of methods in macros TTMATH_LOG()
added: uint AddVector(const uint * ss1, const uint * ss2, uint ss1_size, uint ss2_size, uint * result)
uint SubVector(const uint * ss1, const uint * ss2, uint ss1_size, uint ss2_size, uint * result)
three forms: asm x86, asm x86_64, no-asm
those methods are used by the Karatsuba multiplication algorithm
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@148 e52654a7-88a9-db11-a3e9-0013d4bc506e
and the result was sometimes very big (even greater than x)
fixed: global function Mod(x) didn't set an ErrorCode object
fixed: global function Round() didn't test a carry
now it sets ErrorCode object
changed: function Sin(x) to Sin(x, ErrorCode * err=0)
when x was very big the function returns zero
now it sets ErrorCode object to err_overflow
and the result is undefined
the same is to Cos() function
changed: PrepareSin(x) is using Big::Mod() now when reducing 2PI period
should be a little accurate especially on a very big 'x'
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@143 e52654a7-88a9-db11-a3e9-0013d4bc506e
'typedef unsigned long long int ulint' has been put inside '#ifdef TTMATH_NOASM'
in order to not confuse a compiler while compiling with strict iso c++
(errors about not defining 'long long' in the c++ standard)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@137 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: UInt::SubInt() in no-asm code is a little faster now
changed: small cosmetic changes in commentaries
deleted: some debug #ifdef's from UInt::Div() (in no-asm code)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@136 e52654a7-88a9-db11-a3e9-0013d4bc506e
sometimes when using -O2 or -O3 GCC doesn't set correctly
the stack pointer (actually the stack is used for other things)
and you can't use instructions like push/pop in assembler code.
All the asm code in x86_64 have been rewritten, now instructions
push/pop are not used, other thing which have access to stack
(like "m" (mask) constraints in Rcl2 and Rcr2) have also gone away,
now the library works well with -O2 and -O3 and the asm code
is a little faster
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@127 e52654a7-88a9-db11-a3e9-0013d4bc506e
all the methods which are using assembler code have been
rewritten to no-asm forms, now we have:
1. asm for x86 file: ttmathuint_x86.h
2. asm for x86_64 file: ttmathuint_x86_64.h
3. no asm file: ttmathuint_noasm.h
(it's used when macro TTMATH_NOASM is defined)
The third form can be used on x86 and x86_64 as well and
on other platforms with a little effort.
(Temporarily I left there some '#ifdef's for debugging.)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@126 e52654a7-88a9-db11-a3e9-0013d4bc506e
used for debugging purposes by macro TTMATH_LOG(msg)
(it is used in nearly all methods in UInt class)
added: macro TTMATH_DEBUG_LOG: when defined then TTMATH_LOG()
put some debug information (to std::cout)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@125 e52654a7-88a9-db11-a3e9-0013d4bc506e
(radix) -- operators '#' and '&', e.g.:
'#sin(1)' was equal '0' -- there was a zero from '#' and then
it was multipied by 'sin(1)'
the parser didn't check whether Big::FromString() has actually
read a proper value -- the method Big::FromString() didn't have
something to report such a situation
fixed: Big::FromString() when the base is 10, the method reads the scientific
part only if such a part it correctly supplied, e.g:
'1234e10', '1234e+10', '1234e-5'
previous '1234e' was treated as: '1234e0' (now parsing stops on 'e' and
the 'e' can be parsed by other parsers, e.g. the mathematical
parser -- now in the parser would be: '1234e' = '1234 * e' = '3354,3597...' )
added: to Int::FromString(): parameter 'const char ** after_source = 0'
if exists it's pointing at the end of the parsed string
added: to UInt::FromString(), Int::FromString(), Big::FromString():
parameter 'bool * value_read = 0' - (if exists) tells
whether something has actually been read (at least one digit)
added: the parser checks itself for the operators for changing the base
(operators '#' and '&')
changed: in the parser: the form with operators '#' and '&' is as follows:
[-|+][#|&]numeric_value
previous was: [-|+][#|&][-|+]numeric_value
removed: Big::FromString() this method doesn't longer recognize operators
for changing the base ('#' and '&')
changed: in the parser: the short form of multiplication has the same
priority as the normal multiplication, e.g.:
'2x^3' = 2 * (x^3)
previous the priority was greater than powering priority
previous: '2x^3' = (2*x) ^ 3
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@113 e52654a7-88a9-db11-a3e9-0013d4bc506e
to make division first and then mutliplication -- the result is more
accurate especially when x is: 90,180,270 or 360
added: global template functions in ttmath.h:
ValueType GradToRad(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 & d, const ValueType & m,
const ValueType & s, ErrorCode * err = 0)
ValueType GradToDeg(const ValueType & x, ErrorCode * err = 0)
added: Parser::SetDegRadGrad(int angle) - 0 deg, 1 rad (default), 2 grad
this affects following functions (in the parser only): sin, cos, tan, cot,
asin, acos, atan, acot
added: functions to the parser: gradtorad(grad), radtograd(rad), degtograd(deg),
degtograd(d,m,s), gradtodeg(grad)
removed: Big::Ln() and Big::Log() some old info was removed
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@110 e52654a7-88a9-db11-a3e9-0013d4bc506e
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"
(the was 10e100000000 iterations in PowInt())
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@108 e52654a7-88a9-db11-a3e9-0013d4bc506e
didn't correctly set the exponent (when the mantisses had different size -
when 'man' was different from 'another_man')
this had impact on operator= too
sample:
Big<2,3> a = 100;
Big<3,5> b;
b = a; // b had a wrong value
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@106 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: the size of built-in variables (constants) in ttmathbig.h
now they consist of 256 32bit words
macro TTMATH_BUILTIN_VARIABLES_SIZE is equal: 256u on a 32bit platform and 128ul on a 64bit platform
added: macro CONSTANTSGENERATOR which is useful for generating constants
(it's used by 'gen' program in 'constgen' directory)
after declaring this macro the methods: ExpSurrounding0() and LnSurrounding1() will be public visible
and the inner loop can do more iterations than TTMATH_ARITHMETIC_MAX_LOOP
changed: in methods: ExpSurrounding0() and LnSurrounding1() - the way of comparising with the last word
(now we're comparing not with the last state but with a state from a few words back)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@105 e52654a7-88a9-db11-a3e9-0013d4bc506e
fixed: Big::Add incorrectly rounded 'this' when both exponents were equal
it caused that sometimes when adding a zero the result has changed
this had impact among other things on FromString() method
"0,8" had different binary representation from "0,80"
changed: renamed: Big::PowUInt(UInt<pow_size> pow) -> Big::Pow(UInt<pow_size> pow)
it returns 2 when there is: 0^0
changed: renamed: Big::PowInt(Int<pow_size> pow) -> Big::Pow(Int<pow_size> pow)
it returns 2 when there is: 0^0 or 0^(-something)
changed: renamed: Big::PowBUInt() -> PowUInt(), Big::PowBInt() -> Big::PowInt()
they return 2 when the arguments are incorrect (like above)
changed: UInt::SetBitInWord(uint & value, uint bit) is taking the first argument by a reference now,
the specific bit is set in the 'value' and the method returns the last state of the bit (zero or one)
added: UInt::GetBit(uint bit_index) - returning the state of the specific bit
changed: UInt::SetBit(uint bit_index) - it's using TTMATH_ASSERT now
changed: Big::Mod2() - it's using mantissa.GetBit() now
added: Big::operator=(double) and Big::Big(double)
added: TTMATH_ASSERT somewhere in ttmathuint64.h
added: UInt::Pow(UInt<value_size> pow) and Int::Pow(Int<value_size> pow)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@104 e52654a7-88a9-db11-a3e9-0013d4bc506e
UInt::FindLeadingBitInWord, UInt::SetBitInWord
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
zero and the carry was set
this error was from the beginning of the TTMath library
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@103 e52654a7-88a9-db11-a3e9-0013d4bc506e
fixed: UInt::FindLeadingBitInWord(x) didn't correctly return result -1 when the x was 0
the mistake made by Thomas Braby, it was not in the 0.8.2 release
changed: tests: we do not test for lahf/sahf instructions now (in 64bit code)
we don't use these instructions
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@97 e52654a7-88a9-db11-a3e9-0013d4bc506e
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
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@85 e52654a7-88a9-db11-a3e9-0013d4bc506e
they are much faster than UInt::Rcl2(1,c) and Rcr2(1,c)
changed: UInt::Rcl() and UInt::Rcr()
we don't longer make the things with moving a half in the left and a half in the right
we simply use Rcl2_one() and Rcl2() /Rcr2_one() and Rcr2()/
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@84 e52654a7-88a9-db11-a3e9-0013d4bc506e
(much faster now)
changed: asm code in: UInt::Rcl2, UInt::Rcr2 (32 and 64bit)
previous versions of Rcl2 and Rcr2 had O(n2) complexity,
now they have O(n) and are much faster
changed: now we do not use LAHF and SAHF instructions (both in 32 and 64 bit code)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@83 e52654a7-88a9-db11-a3e9-0013d4bc506e
32 and 64 bits, much faster now
added: tests for UInt::AddInt
fixed: tests: test_lahf() returned incorrect value for 32bit platform
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@82 e52654a7-88a9-db11-a3e9-0013d4bc506e
there were used 'lahf' and 'sahf' instructions
probably they are supported in a new version of GCC
with '-msahf' option but GCC 4.2.1 has no such option
at the moment I'm using opcodes:
lahf -> 9f
sahf -> 9e
Warning! these instructions are not on all 64bit processors
from: http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
"Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
by AMD64 until introduction of Pentium 4 G1 step in December 2005."
changed: UInt::Add on 64bit platform
changed: UInt::Add on 32bit platform (a little)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@80 e52654a7-88a9-db11-a3e9-0013d4bc506e
which is pointing at the end of the parsing string
added: initial import of tests: testing UInt::Add method
(not finished)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@79 e52654a7-88a9-db11-a3e9-0013d4bc506e
the changes which were made in revision 60 and 63
(I forgot to change the info there)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@67 e52654a7-88a9-db11-a3e9-0013d4bc506e
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)
I changed this due to some prior errors
(errors corrected in revision 17, 49 and 58)
added: in Big::MulInt() checking whether the values are zeros
and if so the metdhod returns zero immediately
removed: file TODO (I didn't use it)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@66 e52654a7-88a9-db11-a3e9-0013d4bc506e
remove the -2 state
added: 'remove_trailing_zeroes' in Big::ToString()
it's either true or false
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@63 e52654a7-88a9-db11-a3e9-0013d4bc506e
e.g. '5y', (it's used only if the second parameter
is a variable or function)
changed: variables and functions are case-sensitive now
added: variables and functions can have underline characters
in their names
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@61 e52654a7-88a9-db11-a3e9-0013d4bc506e
for converting from another kind of a Big class
added: to the parser: avg(), sum()
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@56 e52654a7-88a9-db11-a3e9-0013d4bc506e
there was SetSign() used when the value was not
defined, and also was a small mistake when the mantissa
was equal one word (on 32bit platforms)
added: uint Big::ToDouble(double&) - converting into double
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@49 e52654a7-88a9-db11-a3e9-0013d4bc506e
Big::ChangeSign()
added: ASinh(), ACosh(), ATanh() /ATgh()/, ACoth() /ACtgh()/
and to the parser as well
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@35 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: UInt::Rcl(uint c=0) and UInt::Rcr(uint c=0) into
UInt::Rcl2(uint bits, uint c) and UInt::Rcr2(uint bits, uint c)
now they can move more than one bit and they are only private
fixed: UInt::Rcl(uint bits, uint c) and UInt::Rcr(uint bits, uint c)
didn't correctly return a carry if the 'bits' were equal
to 'value_size*TTMATH_BITS_PER_UINT'
changed: UInt::Rcl(uint bits, uint c) and UInt::Rcr(uint bits, uint c)
into UInt::Rcl(uint bits, uint c=0) and
UInt::Rcr(uint bits, uint c=0)
they are faster now when the bits is greater than a half of
the TTMATH_BITS_PER_UINT
changed: UInt::CompensationToLeft() it's faster now
changed: more small changes where there were UInt::Rcl(uint c=0) and
UInt::Rcr(uint c=0) used
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@34 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: Big::MulUInt(uint)
changed: Big::MulInt(sint)
added: Big::ToUInt(uint &)
changed: Big::ToInt(sint&)
changed: Factorial() it uses Big::MulUInt() at the beginning
(faster now especially more on a 32bit platform)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@33 e52654a7-88a9-db11-a3e9-0013d4bc506e
(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)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@32 e52654a7-88a9-db11-a3e9-0013d4bc506e
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
changed: class Objects in ttmathobjects.h has been completely rewritten, we can
change the names of user-defined variables or functions, and the names are
case-sensitive now
added: class History which is used in functions which take a lot of time
during calculating e.g. Factorial(x)
added: Tg(x) a wrapper for Tan(x)
changed: CTan(x) is Cot(x) now
added: Ctg(x) a wrapper for Cot(x)
added: ATg(x) a wrapper for ATan(x)
changed: ACTan(x) is ACot(x) now
added: ACtg(x) a wrapper for ACot(x)
added: UInt::PrintTable() (for debugging etc.)
changed: the methods Big::SetPi() Big::SetE() and Big::SetLn2() have been
rewritten, now they have 128 32bit words (it's about 1232 valid
decimal digits)
fixed: previous values from Big::SetPi() Big::SetE() and Big::SetLn2() were
not too much accurate (last 2-3 words were wrong)
added: Big::SetLn10() (128 32bit words as well)
added: macro: TTMATH_BUILTIN_VARIABLES_SIZE which is equal 128u on 32bit
platforms and 64ul on 64bit platforms (128/2=64)
added: macros: TTMATH_PLATFORM32 and TTMATH_PLATFORM64
changed: a small optimisation in UInt::Mul2Big()
added: at the end of ttmath.h: #include "ttmathparser.h"
this is for convenience for a programmer, he can only use #include
with ttmath.h even if he uses the parser
added: to samples: big.cpp, parser.cpp
fixed: constructor Big::Big(uint) - it was wrong because
it was using the method Big::FromInt(sint) which could produce wrong
values (if the 'uint' couldn't correctly be casted into the 'sint')
added: Big::FromUInt(uint)
changed: Big::FromInt(sint), Big::SetOne(), renamed Big::SetDotOne() into
Big::Set05()
(they are a little faster now)
added: Big::operator=(uint)
changed: in 64bit mode: constructor: Big::Big(int)
added: in 64bit mode: constructor: Big::Big(unsigned int),
operators: Big::operator=(signed int) and Big::operator=(unsigned int)
(these operators and the constructor take a 32bit value)
deleted: the word 'virtual' from destructors: UInt, Int, Big
(types in this library are not projected to be base-classes for
another ones derived from them)
changed: UInt::operator=(uint), UInt::UInt(uint), Int::operator=(sint), Int::Int(sint)
added: UInt::FromUInt(uint), UInt::operator=(sint), UInt::UInt(sint),
Int::FromInt(sint), Int::operator=(uint), Int::Int(uint),
Int::operator==(const Int<>&), Int::operator!=(const Int<>&)
added: in 64bit mode: UInt::operator=(unsigned int), UInt::UInt(unsigned int),
UInt::operator=(signed int), UInt::UInt(signed int)
(these operators and the constructors take a 32bit value)
added: in 64bit mode: Int::operator=(signed int), Int::Int(signed int),
Int::operator=(unsigned int), Int::Int(unsigned int)
(these operators and the constructors take a 32bit value)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@25 e52654a7-88a9-db11-a3e9-0013d4bc506e
(user-defined variables/functions in the mathematical parser)
added: into the parser: logical operators: > < >= <= == != && ||
added: into the parser: logical functions: and() or() not() if()
changed: a method for looking for a mathematical operator
(there's the operators table now)
added: ErrorCode::err_unknown_operator when the parser couldn't read an operator
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@23 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: Big::Sgn - the 'sign' from the value (-1,0,1)
added: global functions Mod and Sgn too
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@19 e52654a7-88a9-db11-a3e9-0013d4bc506e
fixed: bad sizes in tables in some 'Set...' methods in the Big class
fixed: Big::FromInt(Int<int_size> value) - the sign must be set at the end because SetSign
checks whether there is zero and depends on it sets the sign or not
(this was the stupid error which causes sometimes the errors 'overflow during printing')
fixed: Big::SetMin - the sign must be set at the and
changed: Big::Pow can use the reference now (the problem was actually with the Big::FromInt)
added: a namespace 'auxiliaryfunctions' (in ttmath.h)
added: ATan - arc tan, ACTan - arc ctan
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@17 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: UInt::SetFromTable for 64bit code (now the support for 64bit
platforms seems to be completed)
added: asin - arc sin, acos - arc cos
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@16 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed Int::Div -- a remainder is not returning now but taking as a parameter (a pointer or reference)
changed order in parameters in UInt::AddTwoInts
added Int::AddInt
added Int::AddTwoInts
added Int::SubInt
changed Int::AddOne and Int::SubOne (much faster now)
fixed a bug in UInt::operator--() and Int::operator--() (there was adding instead of subtracting)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@13 e52654a7-88a9-db11-a3e9-0013d4bc506e
added UInt::AddInt and UInt::SubInt
changed UInt::AddOne and UInt::SubOne (much faster now)
added UInt::SetBitInWord
changed UInt::SetBit (much faster now)
UInt::AddTwoUints renamed to UInt::AddTwoInts
UInt::FindLeadingBit32 renamed to UInt::FindLeadingBitInWord
added UInt::SetBitInWord
UInt::Mul64 renamed to UInt::MulTwoWords
UInt::Div64 renamed to UInt::DivTwoWords
and more small changes in UInt type
start adding support for Amd64 (not finished yet) (added ttmathuint64.h)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@12 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed kind of templates in ttmath.h (template<class ValueType> is now)
added TTMATH_RELEASE macro
added TTMATH_ prefix into macros
changed multiplication in UInt type (now we can use both algorithm in the same time)
added ExceptionInfo, ReferenceError and RuntimeError classes
now TTMATH_ASSERT throws another type of object
added TTMATH_REFERENCE_ASSERT (it is instead of MATHTT_THIS_ASSERT)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@3 e52654a7-88a9-db11-a3e9-0013d4bc506e