Is there a good way to optimize the multiplication of two BigNums?
问题 I have a class BigNum : struct BigNum{ vector <int> digits; BigNum(vector <int> data){ for(int item : data){d.push_back(item);} } int get_digit(size_t index){ return (index >= d.size() ? 0 : d[index]); } }; and I'm trying to write code to multiply two BigNum s. Currently, I've been using the traditional method of multiplication, which is multiplying the first number by each digit of the other and adding it to a running total. Here's my code: BigNum add(BigNum a, BigNum b){ // traditional