Having trouble with computing the sum until the partial sums are less than tolerance in Python

前端 未结 0 1622
天命终不由人
天命终不由人 2021-02-03 10:37

This is my coding.

def compute_sum(a, b, tolerance=1e-5):
    """Compute the sum $\\sum^\\infty_{n=1} a^n / b^{n-1} until the partial sums are less         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题