Algorithm
1. Pad to power of 2, size 2N. 2. FFT both. 3. Pointwise multiply. 4. Inverse FFT. Result = product coefficients.
Advertisement
NTT for integer results
Modular FFT: primitive roots of unity in ℤ/p. Handles integer polys exactly.
Advertisement
Karatsuba vs FFT
Karatsuba: O(N^1.585). FFT: O(N log N). FFT wins for N > ~1000.
Big integers
Big-integer multiplication reduces to polynomial multiplication over digit sequences. Python big ints use FFT for very large.