C
C#2mo ago
SWEETPONY

✅ How to speed up execution of BigInteger.Pow?

I have this: var result = BigInteger.Pow(1000, 10000000); I know this is a big number but generation of this number takes too much time. Is it possible to speed up?
8 Replies
Angius
Angius2mo ago
I don't think anybody bothered to optimize for such outlandish exponents tbh
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Anton
Anton2mo ago
do you need the precision?
canton7
canton72mo ago
It looks like BigInteger.Pow10 exists, and is likely more optimised Yeah, BigInteger.Pow uses square-and-multiply, but Pow10 uses lookup tables. However, it looks like they only go up to 10^512. It should speed things up though Of course, 1000^10000000 is (10^3)^10000000 is 10^30000000
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
SWEETPONY
SWEETPONYOP2mo ago
I'm here. Actually I don't understand what is BigInteger.Pow10 and how should I use it
canton7
canton72mo ago
@TeBeCo Did you close this? Looks like it should still be open
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server