converges to e*. Use the first 20 terms of the series to approximate e. Use vector operation without...

你可以尝试用以下的R代码来实现:#设定最大的n n <- 20#计算第n项的值 x <- (1 + 1/n)^n#计算前20项的和 sum <- sum((1 + 1/1:n)^1:n)#计算渐近值 e <- x/sumprint(e)

猜你喜欢

转载自blog.csdn.net/weixin_42590539/article/details/129563737
今日推荐