Welcome to my Infinite Multiplier! It can multiply any two numbers and come out with the exact value no matter the size! (although it only evaluates positive integers, but that's besides the point) One annoying issue with computers is that they use limited amounts of code to generate numbers, and thus if a number is big enough, the exact number will not be displayed, but will be put in scientific notation, preventing you from seeing the exact values that you may want to see. When a program asks a computer to multiply two very large numbers, the computer may not have enough code to generate the exact number. But this project can. How it works: When you're in elementary school, you don't use calculators to multiply, but learn to do it by hand. You stack the two numbers and multiply the right-most digit by each digit on the top number times the place value, carrying the one whenever necessary. You repeat this process, moving up one place value with the bottom number until the problem is complete and you have the product. This project essentially does the same thing. Instead of simply plugging in the numbers and letting the computer spit out a response, this algorithm is designed to manually evaluate the equation step-by-step so that when finished, an exact value is given rather than one using scientific notation, no matter how large the number is. Step 1: When you state the numbers you want to multiply, 2 lists are filled in. They each represent one of the numbers the algorithm needs to multiply. Each digit is given its own item in its respective list, but the items are filled in backwards. For example, if #1 was 537, the #1 list would have 7, 3, and 5 as its entries in that order. Both lists are filled in with their values. Step 2: Starting at the beginning of each list, the first item of list 1 is multiplied by each item of list 2, and then the second item of list 1 is multiplied by each item of list 2, and so on until all of the digits have been multiplied as intended. The products of these multiplications are put in their respective places. Step 3: Though the products have been put in, the ones have not been carried. Thus, after all the multiplication is in, the algorithm rolls through the different items of the product list. Some of them may be 10 or more. For instance, if 7 and 4 were multiplied, one of the items might read "28". Thus, 2 would be added to the following item, and the item that initially had the 28 would be changed to 28 mod 10, or 8. By doing this, the ones are carried properly so that the algorithm functions as necessary. Step 4: Once the values in the list are all correct, the product is created digit-by-digit. Starting at the end of the list, the product becomes "join (Product) (item i of Product)", going through each item of the product so that the product of the two numbers is eventually put together without needing scientific notation. And that's how it's done. In the future I might try to make it work for decimals and negative numbers, but I'm also lazy, so, we'll see.
All code by me. Algorithm by me, but inspired by elementary school method of multiplying numbers (multiplying individual digits from both numbers, starting at the lower numbers and progressing upwards). Infinite Addition: https://scratch.mit.edu/projects/971004419/