![]() |
#2
lanyingjie2014-10-28 22:04
|
编程求e^x的近似值,要求最后一项的值小于等于0.000001时停止计算,e^x=1+x/1!+x^2/2!+x^3/3!+...+x^n/n!
Private sub command1_click( )
x=val(text1.text)
s=1:n=1
t=x/n
Do while t>0.000001
s=s+t
n=n+1
t=t*x/n
loop
label3.caption=s
end sub