Thread: Why?
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK[_2_] NickHK[_2_] is offline
external usenet poster
 
Posts: 29
Default Why?

tennin,
Floating point calculations are not guarenteed to give answer you may
expect.

Depending on your needs, either Format the answer or

c=(CLng(a*100)-CLng(b*100)) /100

NickHK

"Tennin" wrote in message
...
why c = 5.99999999999998E-02 ?
Note: Excel XP SP3

Sub test()
Dim a As Double
Dim b As Double
Dim c As Double
a = 1.42
b = 1.36
c = a - b
Debug.Print c
End Sub