Exponential and logarithm operations - General - Algorand
Exponential and logarithm operations
post by cotunho on May 18, 2021
Hi everybody,
I’m writing a smart contract stateful in PyTeal in which I have to implement some operations, including the power and logarithm operation. It’s known that it isn’t possible to use loops in PyTeal, but which can be an arithmetic alternative to implement power and logarithm?
Thanks for all the tips!
post by fabrice on May 18, 2021
Currently it is hard except in specific cases (e.g., small exponents where you can unroll the loop).
But these functions are coming to future versions of TEAL. Stay tuned!
post by Maugli on May 18, 2021
You should specify the range of x values you are interested in, also the allowable error %.
Then it could be decided how to proceed.