I have a class for complex numbers and an exponential function. This
event handler does not reach Expz in debug mode:
z = New Complex(CDbl(Re al.Text), CDbl(Imag.Text) )
Real.Text = CStr(z.Expz().G etReal())
Imag.Text = CStr(z.Expz().G etImaginary())
But when I do this
z = z.Expz()
Real.Text = CStr(z.GetReal( ))
Imag.Text = CStr(z.GetImagi nary())
Or even this
Dim w As Complex = z.Expz()
Real.Text = CStr(z.Expz().G etReal())
Imag.Text = CStr(z.Expz().G etImaginary())
it executes the calculation and displays it. What's up here?
Jon Cosby
*************** *************** *************** ***************
Public Class Complex
Private Shared re As Double
Private Shared im As Double
Public Sub New(ByVal x As Double, ByVal y As Double)
re = x
im = y
End Sub
Public Shared Function Expz() As Complex
Dim w As Complex
w = New Complex(Exp(re) * Cos(im), Exp(re) * Sin(im))
Return w
End Function
event handler does not reach Expz in debug mode:
z = New Complex(CDbl(Re al.Text), CDbl(Imag.Text) )
Real.Text = CStr(z.Expz().G etReal())
Imag.Text = CStr(z.Expz().G etImaginary())
But when I do this
z = z.Expz()
Real.Text = CStr(z.GetReal( ))
Imag.Text = CStr(z.GetImagi nary())
Or even this
Dim w As Complex = z.Expz()
Real.Text = CStr(z.Expz().G etReal())
Imag.Text = CStr(z.Expz().G etImaginary())
it executes the calculation and displays it. What's up here?
Jon Cosby
*************** *************** *************** ***************
Public Class Complex
Private Shared re As Double
Private Shared im As Double
Public Sub New(ByVal x As Double, ByVal y As Double)
re = x
im = y
End Sub
Public Shared Function Expz() As Complex
Dim w As Complex
w = New Complex(Exp(re) * Cos(im), Exp(re) * Sin(im))
Return w
End Function
Comment