isaacholt100 / bnum

Arbitrary, fixed size numeric types that extend the functionality of primitive numeric types in Rust.
https://crates.io/crates/bnum
Other
67 stars 8 forks source link

Implement faster multiplication algorithm #1

Open isaacholt100 opened 2 years ago

isaacholt100 commented 2 years ago

Currently, the multiplication algorithm for integers is long multiplication, which is slow for large numbers (O(n^2)). For integers of size beyond a given threshold, faster algorithms should be used such as Karatsuba, Toom-Cook, and maybe also Schonage-Strassen. This will also allow a divide and conquer division to be used which will have the same time complexity as the multiplication algorithm.