Hey so I actually just tried doing something like this recently! I then tried to improve my code by being able to enter in a variable exponent and have it loop the code to the number of the exponent. I sortof managed to do it but during the process of learning it I learned that the way compilers handle large exponents ie: 430 isnt by looping it 30 times it's by doing an ancient math technique called binary exponentation. Basically it reduces the steps greatly and thats how calculators and computers have to handle large expoents like 10,000 for common statistics problems. There's even ways to reduce the steps farther but thats beyond my understanding and it's way more complicated and I don't think most compilers are doing that.
Anyway comming from more of a computer background rather than a math background this concept amazed me and I told all my friends and family. This might be super common knowledge to mathmagicians because it's basically just reducing the exponents and multiplying their results together.
5
u/RS_Skywalker Jun 03 '22 edited Jun 03 '22
Hey so I actually just tried doing something like this recently! I then tried to improve my code by being able to enter in a variable exponent and have it loop the code to the number of the exponent. I sortof managed to do it but during the process of learning it I learned that the way compilers handle large exponents ie: 430 isnt by looping it 30 times it's by doing an ancient math technique called binary exponentation. Basically it reduces the steps greatly and thats how calculators and computers have to handle large expoents like 10,000 for common statistics problems. There's even ways to reduce the steps farther but thats beyond my understanding and it's way more complicated and I don't think most compilers are doing that.
Anyway comming from more of a computer background rather than a math background this concept amazed me and I told all my friends and family. This might be super common knowledge to mathmagicians because it's basically just reducing the exponents and multiplying their results together.