Commit Graph

48 Commits

Author SHA1 Message Date
Tomasz Sowa f88cba2688 fixed: in Parser: there was an error returned when we parsed a string which at the end had a percentage operator e.g. "10+20%"
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1226 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-10-23 12:38:22 +00:00
Tomasz Sowa d93d5ffd74 some work in the parser and refactoring
added a new math operator: assign
now we can assign a value to a variable (not finished yet)




git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1137 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-10-30 21:04:06 +00:00
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 b36821024b changed: in Parser: the last commit has been changed to:
oper.erase(oper.begin() + oper.size() - 1)
	 because oper.pop_back() is available from c++11 



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1049 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-03-12 12:34:01 +00:00
Tomasz Sowa cd740c5924 changed: in Parser: oper.erase( --oper.end() ) changed to oper.pop_back()
to allow use of the STL port
         (reported on the ttmath forum by Sebo)



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1047 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-02-08 09:02:52 +00:00
Tomasz Sowa f4f7882387 changed: changed code in some places to remove warnings generated by Visual Studio
added:   file win64_assemble.bat to compile (assemble) *.asm file for Win64



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1045 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-02-07 20:42:43 +00:00
Tomasz Sowa b862422bd9 fixed: in Parser: in method SetDegRadGrad(int angle)
there is incorrectly use || operator (the && shoud be used)
       reported by heby on the ttmath forum


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@450 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-04-04 23:36:48 +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 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 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 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 32b8c7a957 removed: from parser: SetSmallToZero(bool zero)
this was actually a bad feature


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@277 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-06 00:54:01 +00:00
Tomasz Sowa 0ada20b4cb fixed: added in the parser: operator's associativity
operator ^ (powering) is right-associative:
        sample: 2^3^4 is equal 2^(3^4) and it is: 2.41e+24
        previously was: 2^3^4 = (2^3)^4 = 4096



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@273 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-12-25 22:06:49 +00:00
Tomasz Sowa 72052420dd fixed: the parser didn't use characters for changing the base (# and &)
those characters were skipped
         (this bug was introduced in 0.9.0)
added:   to Big::ToString() - additional rounding when conv.base_round is used
         if the value is not an integer we calculate how many valid digits there are
         after the comma operator (in conv.base radix) and then we skipped the rest
         digits, after skipping the base-rounding is made
         this helps to print values which have some last clear bits in the mantissa
         consider this 32 bit value:
         (binary)0.00011100001010001111010111000000000
         which has mantissa equal: (binary)11100001010001111010111000000000 (32 bits)
         previous the ToString() method gave: (decimal)0.10999999[...] 
         now we have: (decimal)0.11
added:   Parser::SetSmallToZero(bool zero) (default true)
         if true then the parser changes small values into zero
         small value means:
         - if the mantissa of the value consists only of one, two or three set bits
         - and these bits are next to each other
         - and the exponent is smaller than about 2 times the number of bits from the mantissa
         this helps to correctly calculate expressions such as: "0.80-3*0.34+0.22"
         now the parser gives zero (previous there was a value very closed to zero)
added:   UInt::FindLowestBit(uint & table_id, uint & index)
         /temporary version - asm version is missing /



git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@256 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-12-05 18:13:53 +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 4f1763d773 added: to the parser: function frac() - remains fraction
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@230 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-11-01 14:20:48 +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 02da809583 added: bool Parser::Calculated()
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
2009-10-13 22:38:08 +00:00
Tomasz Sowa f19078f9f1 fixed: Factorial(const ValueType & x, ErrorCode * err = 0)
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
2009-09-17 23:18:11 +00:00
Tomasz Sowa adc5015ad9 small optimization in Parser::Parse(const wchar_t *)
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@194 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-09-13 19:29: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 b3d27979d0 changed: removing some MS VC warnings when compiling x86_64 target
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@191 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-09-11 20:48:52 +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 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 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 fca1bc1a33 added: Objects::IsDefined(const std::string & name)
returning true if such an object is defined


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@117 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-04-02 05:21:49 +00:00
Tomasz Sowa c65857297b fixed: the parser didn't correctly treat operators for changing the base
(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
2009-03-28 17:40:36 +00:00
Tomasz Sowa d695785cbb fixed: in function DegToRad(const ValueType & x, ErrorCode * err = 0) it is better
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
2009-03-27 22:26:51 +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 61886fc829 added: Big::FromBig() and an operator= and a contructor
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
2007-11-04 21:56:04 +00:00
Tomasz Sowa 93ba8ce17d changed: the parser is allowed to recognize values which
begin with a dot, e.g '.5' is treated as '0.5'


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@46 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-07-22 14:15:44 +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 2116418f08 added: UInt::BitAnd(), UInt::BitOr(), UInt::BitXor(), UInt::BitNot(),
Big::BitAnd(), Big::BitOr(), Big::BitXor()
added: to the parser: bitand(), bitor(), bitxor()
       /band(), bor(), bxor()/


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@36 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-13 18:14:11 +00:00
Tomasz Sowa 062881900a changed: small changes in: Big::SetPi(), Big::Set05Pi(), Big::Set2Pi(),
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
2007-04-12 17:17:22 +00:00
Tomasz Sowa e40ed603c6 added: UInt::MulInt(int, UInt<int another_size>::&)
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
2007-04-07 22:21:31 +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 1a12d3692a added: Big::Mod - the remainder from a division
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
2007-02-28 17:52:53 +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 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
Tomasz Sowa 1dabd725cb changed the sequence of arguments in logarithm functions
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
2007-01-22 20:25:45 +00:00
Tomasz Sowa ab42f75285 initial import
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-01-21 20:02:44 +00:00