B
bintom
I ran the following simple code in C++ and got unexpected results:
float f = 139.4;
cout << f;
Output:
139.399994;
if( f == 139.4)
cout << "Expected result";
else
cout << "Unexpected result";
Output:
Unexpected reult
I ran the following equivalent code in VB but got the correct results.
Dim f As Single
f = 139.4
Print f
If f = 139.4 Then
Print "Expected result"
Else
Print "Unexpected result"
End If
Doesn't this look bad on C++'s resume?
float f = 139.4;
cout << f;
Output:
139.399994;
if( f == 139.4)
cout << "Expected result";
else
cout << "Unexpected result";
Output:
Unexpected reult
I ran the following equivalent code in VB but got the correct results.
Dim f As Single
f = 139.4
Print f
If f = 139.4 Then
Print "Expected result"
Else
Print "Unexpected result"
End If
Doesn't this look bad on C++'s resume?