mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Revert "Change mantissa iterators that rely on out-of-bounds indices back to pointers"
This reverts commit cf8898eda6
.
This commit is contained in:
parent
8bb2ae401c
commit
a33723fb14
2 changed files with 11 additions and 11 deletions
|
@ -377,7 +377,7 @@ PNUMBER numtonRadixx(_In_ PNUMBER a, uint32_t radix)
|
|||
{
|
||||
PNUMBER pnumret = i32tonum(0, BASEX); // pnumret is the number in internal form.
|
||||
PNUMBER num_radix = i32tonum(radix, BASEX);
|
||||
MANTTYPE *ptrdigit = a->mant.data(); // pointer to digit being worked on.
|
||||
vector<MANTTYPE>::iterator ptrdigit = a->mant.begin(); // iterator pointing to digit being worked on.
|
||||
|
||||
// Digits are in reverse order, back over them LSD first.
|
||||
ptrdigit += a->cdigit-1;
|
||||
|
@ -1028,7 +1028,7 @@ int32_t numtoi32( _In_ PNUMBER pnum, uint32_t radix )
|
|||
{
|
||||
int32_t lret = 0;
|
||||
|
||||
MANTTYPE *pmant = pnum->mant.data();
|
||||
vector<MANTTYPE>::iterator pmant = pnum->mant.begin();
|
||||
pmant += pnum->cdigit - 1;
|
||||
|
||||
int32_t expt = pnum->exp;
|
||||
|
@ -1200,7 +1200,7 @@ wstring NumberToString(_Inout_ PNUMBER& pnum, int format, uint32_t radix, int32_
|
|||
// Set up all the post rounding stuff.
|
||||
bool useSciForm = false;
|
||||
int32_t eout = exponent - 1; // Displayed exponent.
|
||||
MANTTYPE *pmant = pnum->mant.data() + pnum->cdigit - 1;
|
||||
vector<MANTTYPE>::iterator pmant = pnum->mant.begin() + pnum->cdigit - 1;
|
||||
// Case where too many digits are to the left of the decimal or
|
||||
// FMT_SCIENTIFIC or FMT_ENGINEERING was specified.
|
||||
if ((format == FMT_SCIENTIFIC) || (format == FMT_ENGINEERING))
|
||||
|
|
|
@ -506,8 +506,8 @@ bool equnum( PNUMBER a, PNUMBER b )
|
|||
|
||||
{
|
||||
int32_t diff;
|
||||
MANTTYPE *pa;
|
||||
MANTTYPE *pb;
|
||||
vector<MANTTYPE>::iterator pa;
|
||||
vector<MANTTYPE>::iterator pb;
|
||||
int32_t cdigits;
|
||||
int32_t ccdigits;
|
||||
MANTTYPE da;
|
||||
|
@ -529,8 +529,8 @@ bool equnum( PNUMBER a, PNUMBER b )
|
|||
else
|
||||
{
|
||||
// OK the exponents match.
|
||||
pa = a->mant.data();
|
||||
pb = b->mant.data();
|
||||
pa = a->mant.begin();
|
||||
pb = b->mant.begin();
|
||||
pa += a->cdigit - 1;
|
||||
pb += b->cdigit - 1;
|
||||
cdigits = max( a->cdigit, b->cdigit );
|
||||
|
@ -574,8 +574,8 @@ bool lessnum( PNUMBER a, PNUMBER b )
|
|||
|
||||
{
|
||||
int32_t diff;
|
||||
MANTTYPE *pa;
|
||||
MANTTYPE *pb;
|
||||
vector<MANTTYPE>::iterator pa;
|
||||
vector<MANTTYPE>::iterator pb;
|
||||
int32_t cdigits;
|
||||
int32_t ccdigits;
|
||||
MANTTYPE da;
|
||||
|
@ -596,8 +596,8 @@ bool lessnum( PNUMBER a, PNUMBER b )
|
|||
}
|
||||
else
|
||||
{
|
||||
pa = a->mant.data();
|
||||
pb = b->mant.data();
|
||||
pa = a->mant.begin();
|
||||
pb = b->mant.begin();
|
||||
pa += a->cdigit - 1;
|
||||
pb += b->cdigit - 1;
|
||||
cdigits = max( a->cdigit, b->cdigit );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue