1. 平方根的计算

def babylonian(s, x0, n_iter):
    x = x0
    for _ in range(n_iter):
        x = (x + s/x)/2
        print(x)
    return x

2. 完全平方数的判断

https://stackoverflow.com/questions/2489435/how-could-i-check-if-a-number-is-a-perfect-square

相关文章:

  • 2022-12-23
  • 2021-05-11
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-07-21
猜你喜欢
  • 2021-07-12
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2021-12-26
相关资源
相似解决方案