I am working on a program in C as a part of Homework in which I have to get the product of two long numbers which are taken as character string. eg: 123456789021 and 132456789098. Since it is taken as a string, I converted them to long long int for the multiplication. But the resulting product will be very large(larger than long long int I guess). Can anyone please suggest me a method to perform this multiplication?
Here's one approach: Consider how you would multiply these numbers by hand, on paper. Implement this method in C. You will have to discover:
0 <= d < 10
usually big integers represented as byte arrays. You can look at Microsoft's BigInteger implementation in DLR. I think they've used algorithms developed by Knuth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With