Anonymous user
Long multiplication: Difference between revisions
Imports in the Haskell entry
(→{{header|REXX}}: removed REXX version 1. -- ~~~~) |
(Imports in the Haskell entry) |
||
Line 1,462:
=={{header|Haskell}}==
<lang haskell>
import Data.List (inits)
digits :: Integer -> [Integer]
digits = map (fromIntegral . digitToInt) . show
lZZ = inits $ repeat 0
Line 1,471 ⟶ 1,475:
polymul = ((map sum . transpose . zipWith (++) lZZ) .) . table (*)
longmult = (foldl1 ((+) . (10 *)) .) . (. digits) . polymul . digits
{{out}}
<pre>340282366920938463463374607431768211456</
== {{header|Icon}} and {{header|Unicon}} ==
|