作业帮 > 综合 > 作业

编程e=1+1/1i+1/2i+...,求求e的近似值,精确小数点后6位,..

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 15:23:53
编程e=1+1/1i+1/2i+...,求求e的近似值,精确小数点后6位,..
编程e=1+1/1i+1/2i+...,求求e的近似值,精确小数点后6位,..
Function nn(n As Long) As Double
Dim i As Long
nn = 1
For i = 1 To n
nn = nn * i
Next
End Function
Function sumn() As Double
Dim i As Long
sumn = 0
For i = 0 To 32767
sumn = sumn + 1 / nn(i)
If xn(x, i) / nn(i) < 0.0000001 Then Exit For
Next
End Function