[poincare] Fix Decimal::templatedApproximate

Before, we used an unsigned mantissa and needed to set the sign
afterwards, but with the signed mantissa we must not do this.
This commit is contained in:
Léa Saviot
2018-10-10 10:14:41 +02:00
committed by EmilieNumworks
parent 7394c56afd
commit 6221669a7e

View File

@@ -205,8 +205,7 @@ template<typename T> T DecimalNode::templatedApproximate() const {
Integer m = signedMantissa();
T f = m.approximate<T>();
int numberOfDigits = Integer::NumberOfBase10DigitsWithoutSign(m);
T result = f*std::pow((T)10.0, (T)(m_exponent-numberOfDigits+1));
return m_negative ? -result : result;
return f*std::pow((T)10.0, (T)(m_exponent-numberOfDigits+1));
}
int Decimal::Exponent(const char * integralPart, int integralPartLength, const char * fractionalPart, int fractionalPartLength, const char * exponent, int exponentLength) {