September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -5,7 +5,6 @@
|
|||
// so this multiplication function takes and returns
|
||||
// long integer strings rather than any kind of native integer
|
||||
|
||||
|
||||
// longMult :: (String | Integer) -> (String | Integer) -> String
|
||||
function longMult(num1, num2) {
|
||||
return largeIntegerString(
|
||||
|
|
@ -13,8 +12,6 @@
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// digitProducts :: [Int] -> [Int] -> [Int]
|
||||
function digitProducts(xs, ys) {
|
||||
return multTable(xs, ys)
|
||||
|
|
@ -37,7 +34,6 @@
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// largeIntegerString :: [Int] -> String
|
||||
function largeIntegerString(lstColumnValues) {
|
||||
var dctProduct = lstColumnValues
|
||||
|
|
@ -60,7 +56,6 @@
|
|||
) : '') + dctProduct.digits;
|
||||
}
|
||||
|
||||
|
||||
// multTables :: [Int] -> [Int] -> [[Int]]
|
||||
function multTable(xs, ys) {
|
||||
return ys.map(function (y) {
|
||||
|
|
@ -79,11 +74,9 @@
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// TEST showing that larged bounded integer inputs give only rounded results
|
||||
// whereas integer string inputs allow for full precision on this scale (2^128)
|
||||
|
||||
|
||||
return {
|
||||
fromIntegerStrings: longMult(
|
||||
'18446744073709551616',
|
||||
|
|
@ -94,5 +87,4 @@
|
|||
18446744073709551616
|
||||
)
|
||||
};
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue