Fixes #1529. Fixed: Incorrect CPDecimalNumber result for 220000/220.

And in general divisions where the quotient had fewer digits than the dividend when disregarding exponent would fail.

We want to stop dividing when we've gone over all the digits in the dividend and the remainder is 0.
This commit is contained in:
Alexander Ljungberg committed 2012-05-10 00:16:56 +01:00
1 parent 82e2c7a0e8
commit 8aaf298466
1 file changed
+1 -1
+1 -1
View File
@@ -765,7 +765,7 @@ function _SimpleDivide(result, leftOperand, rightOperand, roundingMode)
n1._mantissa = [];
while ((k < leftOperand._mantissa.length) || (n1._mantissa.length
while ((used < leftOperand._mantissa.length) || (n1._mantissa.length
&& !((n1._mantissa.length == 1) && (n1._mantissa[0] == 0))))
{
while (CPOrderedAscending == CPDecimalCompare(n1, rightOperand))