Our new rounding actually does nothing. So let's not round.

This commit is contained in:
JoelKatz
2012-12-11 00:17:11 -08:00
parent f2ff4b3773
commit 42e3453073

View File

@@ -941,11 +941,6 @@ STAmount STAmount::multiply(const STAmount& v1, const STAmount& v2, const uint16
--offset1;
}
}
else
{ // round
value1 *= 10;
--offset1;
}
if (v2.mIsNative)
{
@@ -955,17 +950,11 @@ STAmount STAmount::multiply(const STAmount& v1, const STAmount& v2, const uint16
--offset2;
}
}
else
{ // round
value2 *= 10;
--offset2;
}
// Compute (numerator*10 * denominator*10) / 10^18 with rounding
CBigNum v;
if ((BN_add_word(&v, value1) != 1) ||
(BN_mul_word(&v, value2) != 1) ||
(BN_add_word(&v, 50) != 1) ||
(BN_div_word(&v, 100000000000000ul) == ((BN_ULONG) -1)))
{
throw std::runtime_error("internal bn error");