mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Fix wrong argument order in std::copy invocations
This commit is contained in:
parent
7da4a7f6fd
commit
98669ef129
4 changed files with 6 additions and 6 deletions
|
@ -1091,7 +1091,7 @@ bool stripzeroesnum(_Inout_ PNUMBER pnum, int32_t starting)
|
||||||
if ( fstrip )
|
if ( fstrip )
|
||||||
{
|
{
|
||||||
// Remove them.
|
// Remove them.
|
||||||
copy(pmant, pnum->mant.begin(), cdigits);
|
copy(pmant, pmant + cdigits, pnum->mant.begin());
|
||||||
// And adjust exponent and digit count accordingly.
|
// And adjust exponent and digit count accordingly.
|
||||||
pnum->exp += ( pnum->cdigit - cdigits );
|
pnum->exp += ( pnum->cdigit - cdigits );
|
||||||
pnum->cdigit = cdigits;
|
pnum->cdigit = cdigits;
|
||||||
|
|
|
@ -459,7 +459,7 @@ void _divnum( PNUMBER *pa, PNUMBER b, uint32_t radix, int32_t precision)
|
||||||
|
|
||||||
if (c->mant.begin() != ++ptrc)
|
if (c->mant.begin() != ++ptrc)
|
||||||
{
|
{
|
||||||
copy(ptrc, c->mant.begin(), cdigits);
|
copy(ptrc, ptrc + cdigits, c->mant.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup table structure
|
// Cleanup table structure
|
||||||
|
|
|
@ -211,7 +211,7 @@ _destroynum(x),(x)=nullptr
|
||||||
int32_t trim = (x)->cdigit - precision-g_ratio;\
|
int32_t trim = (x)->cdigit - precision-g_ratio;\
|
||||||
if ( trim > 1 ) \
|
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)->cdigit -= trim; \
|
||||||
(x)->exp += 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;\
|
int32_t trim = (x)->pp->cdigit - (precision/g_ratio) - 2;\
|
||||||
if ( trim > 1 ) \
|
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->cdigit -= trim; \
|
||||||
(x)->pp->exp += trim; \
|
(x)->pp->exp += trim; \
|
||||||
} \
|
} \
|
||||||
|
|
|
@ -695,7 +695,7 @@ void trimit( PRAT *px, int32_t precision)
|
||||||
}
|
}
|
||||||
else
|
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->cdigit -= trim-pp->exp;
|
||||||
pp->exp = 0;
|
pp->exp = 0;
|
||||||
}
|
}
|
||||||
|
@ -706,7 +706,7 @@ void trimit( PRAT *px, int32_t precision)
|
||||||
}
|
}
|
||||||
else
|
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->cdigit -= trim-pq->exp;
|
||||||
pq->exp = 0;
|
pq->exp = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue