Integer Multiplication | Index << >> |
x←6 2 3 7 4 y←9 3 5 8 0 5 x ∘.× y 54 18 30 48 0 30 18 6 10 16 0 10 27 9 15 24 0 15 63 21 35 56 0 35 36 12 20 32 0 20 54 18 30 48 0 30 18 6 10 16 0 10 27 9 15 24 0 15 63 21 35 56 0 35 36 12 20 32 0 20 ptimes ← {+⌿(-⍳⍴⍺)⌽⍺∘.×⍵,0×1↓⍺} x ptimes y 54 36 63 130 88 101 86 47 35 20 carry←{{¯1↓+⌿0 1⌽0,0 10⊤⍵}⍣≡⍵,0} carry x ptimes y 4 1 7 6 1 1 7 6 0 4 2 47326 × 508539 24067116714 |