From 85d1b87ac00d591d3ce84458c608209a3766c2ff Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Wed, 25 Mar 2009 02:01:42 +0000 Subject: [PATCH] added: '#ifndef __GNUC__' to Big::Pow() where is using '#pragma warning' in order to not confuse GCC git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@109 e52654a7-88a9-db11-a3e9-0013d4bc506e --- CHANGELOG | 6 +++++- ttmath/ttmathbig.h | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index dc12c2b..27f6189 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Version 0.8.3 prerelease (2009.03.24): +Version 0.8.3 prerelease: * fixed: RclMoveAllWords() and RcrMoveAllWords() sometimes didn't return 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 @@ -18,6 +18,10 @@ Version 0.8.3 prerelease (2009.03.24): Big<2,3> a = 100; Big<3,5> b; b = a; // b had a wrong value + * fixed: Big::Pow(const Big & pow) + 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" + (there was 10e100000000 iterations in PowInt()) * changed: UInt::FromString, added a parametr 'after_source' which is pointing at the end of the parsing string * changed: renamed: Big::PowUInt(UInt pow) -> Big::Pow(UInt pow) diff --git a/ttmath/ttmathbig.h b/ttmath/ttmathbig.h index c24b6ad..070f98f 100644 --- a/ttmath/ttmathbig.h +++ b/ttmath/ttmathbig.h @@ -1642,7 +1642,9 @@ public: // MS Visual Express 2005 reports a warning (in the lines with 'uint man_diff = ...'): // warning C4307: '*' : integral constant overflow // but we're using 'if( man > another_man )' and 'if( man < another_man )' and there'll be no such a situation here + #ifndef __GNUC__ #pragma warning( disable: 4307 ) + #endif if( man > another_man ) { @@ -1655,9 +1657,10 @@ public: uint man_diff = (another_man - man) * TTMATH_BITS_PER_UINT; c += exponent.AddInt(man_diff, 0); } - + + #ifndef __GNUC__ #pragma warning( default: 4307 ) - + #endif // mantissa doesn't have to be standardized (either the highest bit is set or all bits are equal zero) CorrectZero();