Hi,
I am currently making a program which can add and multiply two numbers with infinite amount of digits.
No I suspect you mean a very very large number of digits, if it were really infinite then you would never reach the end of the calculation.
OK spliting hairs aside you have a couple of options (I have done this sort of thing before myself).
The reason that the additional is easier is that you can do it on a column by column basis, you can't do that with multiplication, but you can take 1 of 2 approches.
Approcach 1: multiplcation is repeated addition for X * Y just add X to itself Y times.
Approcach 2: More complex but requires less computaion. If you are multiplying X by a single digit then you can do the multiplcation of a digit by digit basis for X. So multiply X by each digit in Y individually, remembering to add extra '0' to get the result in the correct place and then add the number of digits in Y results together to get the final result.
i.e. program the computer to do long multiplication
-
648546
-
x 123
-
-
= (648546 * 1 * 100) + (648546 * 2 * 10) + (648546 * 3)
-
-
= (64854600) + (12970920) + (1945638)
-
-
64854600
-
12970920
-
+1945638
-
--------
-
79771158
-