Finding real roots of quadratic equation.
Finding real roots of quadratic equation.
Rate Finding real roots of quadratic equation.
(1(1 Vote))
Private Type QuaEqu
x1 As Double
x2 As Double
End Type
Dim d As Double
Private Function RootsOfQuaEqu(ByVal a As Single, ByVal b As Single, ByVal c As Single) As QuaEqu
d = (b * b - 4 * a * c)
If d < 0 Then
MsgBox "Roots are Imaginary"
Exit Function
End If
RootsOfQuaEqu.x1 = (-b + Sqr(d)) / (2 * a)
RootsOfQuaEqu.x2 = (-b - Sqr(d)) / (2 * a)
End Function
Finding real roots of quadratic equation. Comments
No comments yet — be the first to post one!
Post a Comment