Created
March 31, 2018 12:39
-
-
Save yarjor/ffb57e9b391bcc6655ba5467bcb16003 to your computer and use it in GitHub Desktop.
[Find root] #math
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def root(n, r): | |
| u, s = n, n+1 | |
| while u < s: | |
| s = u | |
| t = (r - 1) * s + n / pow(s, r-1) | |
| u = t / r | |
| return s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment