Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, try to run this code: [co

Status
Not open for further replies.

BML

Programmer
Oct 24, 2000
37
PT
Hi,

try to run this code:
Code:
'------------------------------------------
Private Sub Form_Load()

  Dim a As Double
  Dim b As Double

  a = 6.3
  b = 1.1 + 2.1 + 3.1
  
  Debug.Print "a = " & a                'a = 6,3
  Debug.Print "b = " & b                'b = 6,3
  Debug.Print "a = b : " & CBool(a = b) 'a = b : False
  Debug.Print "a - b = " & a - b
                            'a-b= -8,88178419700125E-16

End Sub
'------------------------------------------
and notice that VB doesn't assume that a is equal to b,
can anyone explain why? regards,

Bruno Loureiro.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top