mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[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:
committed by
EmilieNumworks
parent
7394c56afd
commit
6221669a7e
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user