diff --git a/src/CalcManager/Ratpack/conv.cpp b/src/CalcManager/Ratpack/conv.cpp index 10f67c17..895159d9 100644 --- a/src/CalcManager/Ratpack/conv.cpp +++ b/src/CalcManager/Ratpack/conv.cpp @@ -1091,7 +1091,7 @@ bool stripzeroesnum(_Inout_ PNUMBER pnum, int32_t starting) if ( fstrip ) { // Remove them. - copy(pmant, pnum->mant.begin(), cdigits); + copy(pmant, pmant + cdigits, pnum->mant.begin()); // And adjust exponent and digit count accordingly. pnum->exp += ( pnum->cdigit - cdigits ); pnum->cdigit = cdigits; diff --git a/src/CalcManager/Ratpack/num.cpp b/src/CalcManager/Ratpack/num.cpp index b5424e91..a9f4b10d 100644 --- a/src/CalcManager/Ratpack/num.cpp +++ b/src/CalcManager/Ratpack/num.cpp @@ -459,7 +459,7 @@ void _divnum( PNUMBER *pa, PNUMBER b, uint32_t radix, int32_t precision) if (c->mant.begin() != ++ptrc) { - copy(ptrc, c->mant.begin(), cdigits); + copy(ptrc, ptrc + cdigits, c->mant.begin()); } // Cleanup table structure diff --git a/src/CalcManager/Ratpack/ratpak.h b/src/CalcManager/Ratpack/ratpak.h index 53c6a479..bd959a9c 100644 --- a/src/CalcManager/Ratpack/ratpak.h +++ b/src/CalcManager/Ratpack/ratpak.h @@ -211,7 +211,7 @@ _destroynum(x),(x)=nullptr int32_t trim = (x)->cdigit - precision-g_ratio;\ if ( trim > 1 ) \ { \ -std::copy((x)->mant.begin() + trim, (x)->mant.begin(), (x)->cdigit-trim);\ +std::copy((x)->mant.begin() + trim, (x)->mant.begin() + (x)->cdigit, (x)->mant.begin());\ (x)->cdigit -= trim; \ (x)->exp += trim; \ } \ @@ -221,7 +221,7 @@ std::copy((x)->mant.begin() + trim, (x)->mant.begin(), (x)->cdigit-trim);\ int32_t trim = (x)->pp->cdigit - (precision/g_ratio) - 2;\ if ( trim > 1 ) \ { \ -std::copy((x)->pp->mant.begin() + trim, (x)->pp->mant.begin(), ((x)->pp->cdigit-trim)); \ +std::copy((x)->pp->mant.begin() + trim, (x)->pp->mant.begin() + (x)->pp->cdigit, (x)->pp->mant.begin()); \ (x)->pp->cdigit -= trim; \ (x)->pp->exp += trim; \ } \ diff --git a/src/CalcManager/Ratpack/support.cpp b/src/CalcManager/Ratpack/support.cpp index c87f206a..70c8deec 100644 --- a/src/CalcManager/Ratpack/support.cpp +++ b/src/CalcManager/Ratpack/support.cpp @@ -695,7 +695,7 @@ void trimit( PRAT *px, int32_t precision) } else { - copy(pp->mant.begin() + (trim-pp->exp), pp->mant.begin(), pp->cdigit-trim+pp->exp); + copy(pp->mant.begin() + (trim-pp->exp), pp->mant.begin() + pp->cdigit, pp->mant.begin()); pp->cdigit -= trim-pp->exp; pp->exp = 0; } @@ -706,7 +706,7 @@ void trimit( PRAT *px, int32_t precision) } else { - copy(pq->mant.begin() + (trim-pq->exp), pq->mant.begin(), pq->cdigit-trim+pq->exp); + copy(pq->mant.begin() + (trim-pq->exp), pq->mant.begin() + pq->cdigit, pq->mant.begin()); pq->cdigit -= trim-pq->exp; pq->exp = 0; }