【答案】求e的x次幂(VB)
问题描述:
【答案】求e的x次幂(VB)
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click
Dim i,s,d,o As Single
Dim ee,temp As Single
d = Val(Me.TextBox1.Text)
i = 1
s = 1
ee = 1.0
o = d
temp = d
Do While temp > 0.000001
ee += temp
i += 1
s *= i
o *= d
temp = (o * 1.0) / s
Loop
Me.TextBox2.Text = CStr(ee)
End Sub
End Class
用的上的吱一声啊
答
吱!
TextBox2.Text = Exp(Val(Me.TextBox1.Text))