请教VB中关于LOG函数的问题,急。

来源:百度知道 编辑:UC知道 时间:2024/06/02 13:04:35
如我有一个函数LgY=0.17179+0.42988LgX-0.37244(lgx)^2+0.17712(lgx)^3-0.029984(lgx)^4
当输入X值时,怎么求Y值啊,求具体的代码,谢谢啊。

Function lg(n As Double) As Double
lg = Log(n) / Log(10)

End Function

Private Sub Command1_Click()
Dim x As Double
Dim Lgy As Double
Dim y As Double

x = 12.3
Lgy = 0.17179 + 0.42988 * lg(x) - 0.37244 * (lg(x)) ^ 2 + 0.17712 * (lg(x)) ^ 3 - 0.029984 * (lg(x)) ^ 4

y = 10 ^ Lgy

Print x, y
End Sub