[求助]关于自然对数的E的值
用近似公式求自然对数的底数e的值,要求计算结果的误差小于10^(-9)
Private Sub Command1_Click()
Dim a As Double, t As Double, i As Integer
i = 2
s = 2
t = 1
Do While t >= 0.000000001
s = s + t / i
t = t / i
i = i + 1
Loop
Print s
End Sub
与
Private Sub Form_Click()
Dim a As Double, t As Double, i As Integer
i = 2
s = 0
t = 1
Do While t >= 0.000000001
s = s + t
t = t / i
i = i + 1
Loop
Print s
End Sub
为什么最后的结果不一样??哪个更好??