Commit Graph

52 Commits

Author SHA1 Message Date
Tomasz Sowa c73af9c116 - changed info in headers in source files: (new) BSD licence -> 3-Clause BSD Licence
- added svn:ignore in some places




git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1051 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-03-12 14:51:21 +00:00
Tomasz Sowa 2067301d1c changed: get rid of some warnings generated by gcc and clang
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1043 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-02-07 14:19:59 +00:00
Tomasz Sowa 506840787a added: some pragmas for the clang compiler:
#pragma clang diagnostic ignored "-Wtautological-compare"
         to get rid off some warning messages
changed: changing version number to 0.9.3 release



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@436 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-11-28 16:19:05 +00:00
Tomasz Sowa 231164f6ea added: option 'group_digits' to Conv struct
you can set how many digits should be grouped



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@338 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-01-30 17:34:42 +00:00
Tomasz Sowa 84f34ebe52 added: Parser::InitCGamma()
initializing coefficients used when calculating the gamma (or factorial) function
       this speed up the next calculations
       you don't have to call this method explicitly
       these coefficients will be calculated when needed



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@324 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-09-29 21:14:32 +00:00
Tomasz Sowa 3190f3011f changing version number to 0.9.2 release
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@320 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-09-23 20:52:20 +00:00
Tomasz Sowa 90674c9505 added: on 32bit platforms:
uint UInt::FromUInt(uint64_t n)
        uint Int::FromInt(int64_t n)
        void Big::FromUInt(uint64_t n)
        void Big::FromInt(int64_t n)        
        and appropriate constructors and operators
added:  TTMATH_FORCEASM macro
        asm version of the library is available by default only for:
        x86 and amd64 platforms and for Microsoft Visual and GCC compilers,
        but you can force using asm version (the same asm as for Microsoft Visual)
        by defining TTMATH_FORCEASM macro
        you have to be sure that your compiler accept such an asm format
                        


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@311 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-09-19 17:23:39 +00:00
Tomasz Sowa a1c41c02db added: bool UInt::IsOnlyTheHighestBitSet()
bool UInt::IsOnlyTheLowestBitSet()
         returning true if only the highest/lowest bit is set
added:   uint Int::MulInt(sint ss2)       
added:   void UInt::Swap(UInt<value_size> & ss2)       
         void Big::Swap(UInt<value_size> & ss2)
         method for swapping this for an argument
changed: small optimization in Big::Sub()
changed: now asm version is available only on x86 and amd64
         (and only for GCC and MS VC compilers)
removed: macro TTMATH_RELEASE
         for debug version define TTMATH_DEBUG macro
         TTMATH_DEBUG is also automatically defined when DEBUG or _DEBUG is set



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@304 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-09-05 18:21:58 +00:00
Tomasz Sowa 1b7e13a9fd added: macro TTMATH_DONT_USE_WCHAR
if defined then the library does not use wide characters
         (wchar_t, std::wstring, ...) this is a workaround for some compilers



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@294 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-03-01 13:08:50 +00:00
Tomasz Sowa aeadb8a04a changed: version of the library: 0.9.1 now
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@286 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-07 18:17:24 +00:00
Tomasz Sowa d5a5ea1a7d removed: from Big::ToString() the feature with calculating how many valid digits there are
after the comma operator
         this was not correctly calculated - sometimes gives unexpected results,
         e.g. 0.5/2/2=0.125 (only one bit in the mantissa) gives 0.1 as the result
changed: cosmetic changes in Big::Add()




git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@283 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-02 21:02:10 +00:00
Tomasz Sowa 321953e833 fixed: the parser didn't use characters for changing the base (# and &)
those characters were skipped
       (this bug was introduced in 0.9.0)



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@255 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-12-02 11:38:17 +00:00
Tomasz Sowa 125c051ea1 changed: version of the library: 0.9.0 now
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@251 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-25 13:49:38 +00:00
Tomasz Sowa e083c5f889 added: const char * UInt::LibTypeStr()
const char * Big::LibTypeStr()
         LibTypeCode UInt::LibType()
         LibTypeCode Big::LibType()
         returning a string/enum 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
changed: another compilers than MS VC or GCC by default use no asm version (TTMATH_NOASM)



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@247 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-24 20:15:46 +00:00
Tomasz Sowa 11b9f389b9 fixed: Int::DivInt() should take parameters as 'sint' and not 'int'
this has impact on 64 bit platforms
fixed: some warnings from Visual C++ (64 bit)


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@245 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-24 06:12:46 +00:00
Tomasz Sowa bac79e0bfa renamed: Conv::comma_digits to Conv::round
added:   bool Conv::base_round
         if 'base_round' is true and 'base' is different from 2, 4, 8, or 16
         and the result value is not an integer then we make an additional rounding
         (after converting the last digit from the result is skipped)
changed: in Big::ToString() some additional rounding (base_round) is now made only 
         when the value is not an integer


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@244 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-24 05:14:54 +00:00
Tomasz Sowa 2feabc64e2 added: struct: Conv
consists of some parameters used
         in ToString() and FromString()
added:   Big::ToString() can group digits
         e.g. 1234567 -> 1`234`567
added:   Parser::SetGroup(int g)
         Parser::SetComma(int c, int c2 = 0)
         Parser::SetParamSep(int s)
added:   uint Big::ToString(std::string & result, const Conv & conv)
         uint Big::ToString(std::wstring & result, const Conv & conv)
         std::string Big::ToString(const Conv & conv) const
         std::string Big::ToString()
added:   uint FromString(const char * source, const Conv & conv, const char **, bool *)
         uint FromString(const wchar_t * source, const Conv & conv, const wchar_t **, bool *)
         uint FromString(const std::string & string, const Conv & conv, const wchar_t **, bool *)
         uint FromString(const std::wstring & string, const Conv & conv, const wchar_t **, bool *)
removed: macros: TTMATH_COMMA_CHARACTER_1 and TTMATH_COMMA_CHARACTER_2
         the comma characters we have in Conv struct now



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@226 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-01 01:40:40 +00:00
Tomasz Sowa bf520689fb added: to the parser: operator percentage
e.g. 1000-50%=1000-(1000*0,5)=500



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@217 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-10-18 12:37:14 +00:00
Tomasz Sowa a8eb29e57d fixed: UInt::SetBitInWord(uint & value, uint bit) set 1 if the bit was
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
2009-10-03 01:10:08 +00:00
Tomasz Sowa 31b8c242bd changed: if TTMATH_DEBUG_LOG is defined then TTMATH_USE_KARATSUBA_MULTIPLICATION_FROM_SIZE is always 3
(regardless of the compiler)


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@202 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-09-20 20:41:11 +00:00
Tomasz Sowa 4c0d8c26ff changed: small optimization in ttmath_subindexed_x64()
(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
2009-09-20 20:10:29 +00:00
Tomasz Sowa da730d1c70 fixed: Big::operator>> didn't correctly recognize values in scientific mode (with 'e' character)
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
2009-09-13 19:16:42 +00:00
Tomasz Sowa 28964d30f7 merged: x86_64 asm code for Microsoft Visual compiler
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
2009-09-07 02:03:00 +00:00
Tomasz Sowa 799e2c32a7 added: multithread support for Big<> class
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
2009-08-04 18:23:35 +00:00
Tomasz Sowa 53547cfab5 * added: global Gamma() function
* 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
2009-07-16 03:22:29 +00:00
Tomasz Sowa d3a64b79ca added: support for wide characters (wchar_t)
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
2009-07-02 01:04:25 +00:00
Tomasz Sowa 8972fdfdb3 fixed: Sqrt(), Root() and Factorial() didn't correctly treat the NaN flag
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
2009-06-16 18:31:39 +00:00
Tomasz Sowa d789ac5396 added: using NaN flag in method Big::ToDouble() and Big::FromDouble()
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
2009-06-11 02:31:41 +00:00
Tomasz Sowa eaa19dd46a added: uint UInt::Mul3(const UInt<value_size> & ss2)
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
2009-05-15 22:27:04 +00:00
Tomasz Sowa 939d0f7519 fixed: Big::Mod(x) didn't correctly return a carry
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
2009-05-11 01:50:00 +00:00
Tomasz Sowa 3231780a85 changed: version of the library: 0.8.4
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@138 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-05-08 19:13:25 +00:00
Tomasz Sowa 1bae0d6cb8 changed: in ttmathtypes.h
'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
2009-05-08 18:40:32 +00:00
Tomasz Sowa 85945b2bb0 added: ttmathuint_x86.h, ttmathuint_x86_64.h, ttmathuint_noasm.h,
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
2009-05-04 20:51:12 +00:00
Tomasz Sowa 1efe39686b added: UInt::PrintLog(const char * msg, std::ostream & output)
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
2009-05-01 14:53:21 +00:00
Tomasz Sowa d8b829f4c5 changed: version of the library: 0.8.3 now
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@120 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-04-06 16:34:19 +00:00
Tomasz Sowa 460608859c added: 'constgen' directory -- there is a program there to generate some constants used in ttmathbig.h
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
2009-03-12 20:54:46 +00:00
Tomasz Sowa 978815f12d 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
         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
2009-03-11 19:05:13 +00:00
Tomasz Sowa 98c2379182 changed: small changes especially cosmetic in documentation (commentaries)
changed: version of the library: now 0.8.2


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@68 e52654a7-88a9-db11-a3e9-0013d4bc506e
2008-06-18 00:33:05 +00:00
Tomasz Sowa f139e6457c added: a short form of multiplication (without the '*' character)
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
2008-01-23 23:45:42 +00:00
Tomasz Sowa 29bb4fb3f7 added: 'decimal_point' parameter into Big::ToString(...)
fixed: Big::operator>> didn't use TTMATH_COMMA_CHARACTER_2 macro


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@60 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-12-09 20:07:45 +00:00
Tomasz Sowa bc9d528a75 added: Uint::BitNot2() this method has been proposed by
Arek <kmicicc AnTispam users.sourceforge.net>


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@41 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-23 21:35:55 +00:00
Tomasz Sowa bb16c871c9 changed: the way of parsing operators in the mathematical parser
(the parser is not too much greedy now)


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@38 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-17 13:42:19 +00:00
Tomasz Sowa c97ebf282f fixed: Big::PowFrac(..) didn't return a correct error code
(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
2007-04-05 19:08:15 +00:00
Tomasz Sowa 837490e8b9 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)/
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
2007-03-28 22:27:57 +00:00
Tomasz Sowa abb8f292ab added: into the parser: SetFactorialMax()
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@24 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-03-21 16:01:50 +00:00
Tomasz Sowa 06e0294841 added: checking whether an user gives a correct value of a variable or function
(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
2007-03-09 19:05:38 +00:00
Tomasz Sowa e14e65002b fixed: removed 'const' from some methods (operators: += -= *= /=) in the Big class
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
2007-02-27 20:18:33 +00:00
Tomasz Sowa d04632ea74 fixed: constraints in asm operands for gcc
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
2007-02-24 18:59:05 +00:00
Tomasz Sowa d4b8bf2202 added: ErrorCode::err_still_calculating (it's used when there is more than one thread)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@15 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-02-08 17:56:35 +00:00
Tomasz Sowa b59de36095 fixed the problem with a sign in the mathematical parser /-(1) was 1/
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
2007-01-29 17:58:18 +00:00