3 ms·
False. You can very much implement the n-th root. Details depend on the number format chosen (fixed vs floating point emulation). The most obvious method is bin
by freemint 4y ago
False. You can very much implement the n-th root. Details depend on the number format chosen (fixed vs floating point emulation).
The most obvious method is binary search. You calculate the n-th power for some number and see if it is larger or smaller then then the number you want the root from and narrow it down.
Equivalents of the doom trick using integer division and instead of >>1 (which is ÷2) of the exponents + a few newton iterations would also do the trick in floating point format
- numtel 4y agoApparently it is possible. [1] I guess I missed that when I was trying before. [1] https://ethereum.stackexchange.com/questions/38468/calculate-the-nth-root-of-an-arbitrary-uint-using-solidity https://ethereum.stackexchange.com/questions/38468/calculate...