How to calculate Python float-number-th root of float number
问题 I found the following answer here on Stackoverflow: https://stackoverflow.com/a/356187/1829329 But it only works for integers as n in nth root: import gmpy2 as gmpy result = gmpy.root((1/0.213), 31.5).real print('result:', result) results in: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-14-eb4628226deb> in <module>() 8 ----> 9 result = gmpy.root((1/0.213), 31.5).real 10 11 print('result:', result)