各位高手,请帮忙持下这代码那里有问题,谢谢!
Private Sub Command1_Click()
Dim q As Double
Dim k As Double
Dim λ As Double
Dim date_q(10000) As Double
Dim b As Double
Dim i As Double
q = Text1
k = Text2
For i = 0 To 10000
λ = i / 10000
b = ((k + 1) / 2) ^ (1 / (k - 1)) * λ * (1 - (k - 1) / (k + 1) * λ * λ) ^ (1 / (k - 1))
date_q(i) = b
Next i
For i = 0 To 10000
If q > date_q(i) Then Next i
If q = date_q(i) Then Exit For
If q < date_q(i) Then Exit For
λ = (i - (date_q(i) - q) / (date_q(i) - date_q(i - 1))) / 10000
Text3.Text = λ
End Sub