mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Update implementation of Number to use the new std::vector mantissa
This commit is contained in:
parent
3355947ed8
commit
c09525471a
1 changed files with 2 additions and 8 deletions
|
@ -23,7 +23,7 @@ namespace CalcEngine
|
||||||
m_mantissa{}
|
m_mantissa{}
|
||||||
{
|
{
|
||||||
m_mantissa.reserve(p->cdigit);
|
m_mantissa.reserve(p->cdigit);
|
||||||
copy(p->mant, p->mant + p->cdigit, back_inserter(m_mantissa));
|
copy(p->mant.begin(), p->mant.begin() + p->cdigit, back_inserter(m_mantissa));
|
||||||
}
|
}
|
||||||
|
|
||||||
PNUMBER Number::ToPNUMBER() const
|
PNUMBER Number::ToPNUMBER() const
|
||||||
|
@ -32,13 +32,7 @@ namespace CalcEngine
|
||||||
ret->sign = this->Sign();
|
ret->sign = this->Sign();
|
||||||
ret->exp = this->Exp();
|
ret->exp = this->Exp();
|
||||||
ret->cdigit = static_cast<int32_t>(this->Mantissa().size());
|
ret->cdigit = static_cast<int32_t>(this->Mantissa().size());
|
||||||
|
ret->mant = this->Mantissa();
|
||||||
MANTTYPE *ptrRet = ret->mant;
|
|
||||||
for (auto const& digit : this->Mantissa())
|
|
||||||
{
|
|
||||||
*ptrRet++ = digit;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue