1. Comparing Long data types and Double data types - Visual Basic/VB
2. Q: Comparing Long data types and Double data types
Richard J wrote: > > Hi group, > > I just ran across the following confusion in the code and was hoping someone could clarify things for me: > > If aSomeArray(1) <> Val(SpreadSheet.Value) Then > bChanged = True > End If > > The value in aSomeArray(1) = 8011008 > The value in SpreadSheet.Value = 8011008 > > At first glance, these two values appear to be the same. However, VB interprets them as unequal. The only difference between the two that I can see is that the array is defined As Long while the VAL statement returns a Double. > > Does this action sound right to everyone? That a Long data type would not equal a Double data type? Yes, if the Double were computed, not entered as an integer. An integer of that magnitude (and much larger besides, since there are 53 bits of mantissa in a Double) is exactly representable in floating point. The problem arises if the value is the result of a calculation done in floating point so that some other non-integer value enters into the computation and floating point precision rears its head. > I'm not looking for how to resolve it; that's the easy part. I'm just looking for someone to explain why the same values are not equal. Well, dealing with comparison of floating point values isn't necessarily so easy--depends on the situation. W/O knowing more, I can only comment "be careful, it may be more subtle than you think".
3. Single and Double Quotes in Data Merge Incorrectly in Word 200
4. Single and Double Quotes in Data Merge Incorrectly in Word 2003
I am merging an Access query with a Word Main document. All fields come in correctly except one that is a measurement. The filed in Access, for example is, 6'02" but when the merge is complete, it shows up in Word as 602 and it is underlined. Does anyone know how to show it as 6'02"?
5. Returning various data types in a single function? - VB.Net
6. Double data type in MS Access
Hi all, There is a column (col1) in Access data base that is adouble data type. In vb.net when I try to set a row filter for a view based on its table as: Dim dv As New DataView(MyDataTable) dv.RowFilter = "Col1 = 9999999999" -- col1=2222222222" doesn't cause problem I get this error message: "The value is to high for and int32" I'm not sure how dotnet treats Access double data type and somehow converted to int32. Please help. Roy Please share your . If this is because
7. Converting C Float value into VB Single data type Help - VB.Net