解释该程序

来源:百度知道 编辑:UC知道 时间:2024/07/03 03:30:51
将最佳答案中的程序用中文解释
http://zhidao.baidu.com/question/38346541.html?si=5
请解释清楚一点,包括代码

Private Sub Command1_Click() '这个不用说了吧,调用解方程函数,输出结果

Dim x1r As Double, x1i As Double, x2r As Double, x2i As Double, x3r As Double, x3i As Double
Dim ret As String

ret = CubicEquation(5, 4, 3, -12, x1r, x1i, x2r, x2i, x3r, x3i) '5x^3+4x^2+3x-12=0

Debug.Print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & ret
Debug.Print x1r; " + "; x1i; " i"
Debug.Print x2r; " + "; x2i; " i"
Debug.Print x3r; " + "; x3i; " i"

End Sub

Private Function CubicEquation _
(ByVal a As Double, ByVal b As Double, ByVal c As Double, ByVal d As Double, _
x1r As Double, x1i As Double, x2r As Double, x2i As Double, x3r As Double, x3i As Double) As String
'Cubic equation(v2.2), coded by www.dayi.net btef (please let this line remain)
Dim e As Double, f As Double, g As Do