diff --git a/ttmath/ttmathbig.h b/ttmath/ttmathbig.h index 6be5d9b..dc6447e 100644 --- a/ttmath/ttmathbig.h +++ b/ttmath/ttmathbig.h @@ -1571,7 +1571,7 @@ public: return 0; } - Big start(*this), start_temp; + Big start(*this); Big result; result.SetOne(); uint c = 0; @@ -1586,8 +1586,7 @@ public: if( pow.IsZero() ) break; - start_temp = start; - c += start.Mul(start_temp); + c += start.Mul(start); } *this = result; @@ -1665,13 +1664,10 @@ public: if( pow.IsSign() ) pow.Abs(); - Big start(*this), start_temp; + Big start(*this); Big result; Big one; - Int e_one; uint c = 0; - - e_one.SetOne(); one.SetOne(); result = one; @@ -1680,13 +1676,12 @@ public: if( pow.Mod2() ) c += result.Mul(start); - c += pow.exponent.Sub( e_one ); // !! may use SubOne() here? + c += pow.exponent.SubOne(); if( pow < one ) break; - start_temp = start; - c += start.Mul(start_temp); + c += start.Mul(start); } *this = result; diff --git a/ttmath/ttmathuint.h b/ttmath/ttmathuint.h index 25ffbb8..8f26626 100644 --- a/ttmath/ttmathuint.h +++ b/ttmath/ttmathuint.h @@ -2370,7 +2370,7 @@ public: // we don't define zero^zero return 2; - UInt start(*this), start_temp; + UInt start(*this); UInt result; result.SetOne(); uint c = 0; @@ -2384,9 +2384,7 @@ public: if( pow.IsZero() ) break; - start_temp = start; - // in the second Mul algorithm we can use start.Mul(start) directly (there is no TTMATH_ASSERT_REFERENCE there) - c += start.Mul(start_temp); + c += start.Mul(start); } *this = result;