How to compute the nth root of a very big integer

后端 未结 10 633
暖寄归人
暖寄归人 2020-12-01 06:28

I need a way to compute the nth root of a long integer in Python.

I tried pow(m, 1.0/n), but it doesn\'t work:

OverflowError: lo

10条回答
  •  生来不讨喜
    2020-12-01 06:53

    Possibly for your curiosity:

    http://en.wikipedia.org/wiki/Hensel_Lifting

    This could be the technique that Maple would use to actually find the nth root of large numbers.

    Pose the fact that x^n - 11968003.... = 0 mod p, and go from there...

提交回复
热议问题