From 8aaf298466f5a73a07859d8dcc610083ee093254 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Thu, 10 May 2012 00:16:56 +0100 Subject: [PATCH] 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. --- Foundation/CPDecimal.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPDecimal.j b/Foundation/CPDecimal.j index fe51942f29..c8b52f739d 100644 --- a/Foundation/CPDecimal.j +++ b/Foundation/CPDecimal.j @@ -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))