#step #multiplication #vertical #big-integer

vertical-multiplication

Vertical multiplication step by step

2 unstable releases

0.1.0 Mar 13, 2023
0.0.0 Mar 13, 2023

#2011 in Algorithms

MPL-2.0 license

7KB
122 lines

Vertical Multiplication Steps

Decimal Multiplication

BigInt::from(12), &BigInt::from(345), 10)
     12
 ×  345
--------
 =   60
 +  48.
 + 36..
--------
 = 4140

Hexadecimal Multiplication

BigInt::from(12), &BigInt::from(345), 16)
     c
 × 159
-------
 =  6c
 + 3c.
 + c..
-------
 = 102c

Binary Multiplication

BigInt::from(12), &BigInt::from(345), 2)
           1100
 ×    101011001
----------------
 =         1100
 +           0.
 +          0..
 +      1100...
 +     1100....
 +       0.....
 +   1100......
 +     0.......
 + 1100........
----------------
 = 1000000101100

Dependencies

~1MB
~18K SLoC