Long multiplication: Difference between revisions

m
→‎Functional (ES 5): Removed a couple of unused parameter names from a .reduce function
m (→‎Functional (ES 5): Removed a couple of unused parameter names from a .reduce function)
Line 2,398:
// Javascript lacks an unbounded integer type
// so this multiplication function needstakes arbitraryand precision integer string argumentsreturns
// (rather than nativelong integer arguments)strings forrather fullthan precisionany atkind scalesof beyondnative c. 2^54integer
 
Line 2,407:
digitProducts(digits(num1), digits(num2))
);
}
 
}
 
// digitProducts :: [Int] -> [Int] -> [Int]
Line 2,436:
function largeIntegerString(lstColumnValues) {
var dctProduct = lstColumnValues
.reduceRight(function (a, x, i, l) {
var intSum = x + a.carried,
intDigit = intSum % 10;
9,659

edits