#step #multiplication #vertical #big-int

vertical-multiplication

Vertical multiplication step by step

2 unstable releases

0.1.0 Mar 13, 2023
0.0.0 Mar 13, 2023

#1900 in Algorithms

35 downloads per month

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
~17K SLoC