I am trying to compute the differnece between two dwords in visual basic and
keep getting the wrong value being computed. I have the following structure
defind:
Public Type HighLowQuote
TradeDate As String
OpenPrice As Double
HighPrice As Double
LowPrice As Double
ClosePrice As Double
Volume As Long
AdjClosePrice As Double
AmtChange As Double
End Type
I create an instance of this type as 'q'. I then do the following:
q.highprice = variant
q.lowprice = variant
at this point the locals variable window shows the values as:
q.highprice = 4.1
q.lowprice = 4
I then fall through the following code:
q.AmtChange = q.highprice - q.lowprice
q.amtchange is then valued at 9.99999999999996E-02 in the locals window when
I believe it should be valued at .1.
Why is the value not being set to .1? Is there a change I can make to get
this calculation to work how I expect or is there some other way to perform
these calculations to get the results I am after?
Any help would be appreciated. Thanks in advance.