zak
04-12-2010, 16:22
i found this tip: suppose you want to know the number of digits in the result of 73 ^ 94 how do you know that without calculating realy this astronomical number?
number of digits = floor(num2*log(num1)) + 1 = floor(94*log(73)) + 1
= 94 * 1.8633228 + 1
= 175.15234885 + 1
so the number of digits is 176, check this with the gmp calculator here:
http://www.thinbasic.com/community/showthread.php?8577-GMP-library-free-library-for-arbitrary-precision-arithmetic/page2
i don't know the difference between floor and int, i think they are the same. unless someone explain more.
you will find more questions here:
http://mathforum.org/dr.math/
number of digits = floor(num2*log(num1)) + 1 = floor(94*log(73)) + 1
= 94 * 1.8633228 + 1
= 175.15234885 + 1
so the number of digits is 176, check this with the gmp calculator here:
http://www.thinbasic.com/community/showthread.php?8577-GMP-library-free-library-for-arbitrary-precision-arithmetic/page2
i don't know the difference between floor and int, i think they are the same. unless someone explain more.
you will find more questions here:
http://mathforum.org/dr.math/