0

Python root

How to calculate the root of a number through a python?

18th Mar 2022, 2:14 AM
Nexus
Nexus - avatar
3 Réponses
18th Mar 2022, 2:51 AM
Gordon
Gordon - avatar
+ 1
Calculate integer square root: def intsqrt(n): x = 2 for i in range(50): x += n//x x >>= 1 return x
20th Mar 2022, 12:43 AM
Brian
Brian - avatar