Update implementation of Number to use the new std::vector mantissa

This commit is contained in:
fwcd 2019-04-06 16:19:47 +02:00
commit c09525471a

View file

@ -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;
} }