3521340885 is less than 0? Is this by design etc? Do I need to always cast 0 (zero) to UInt32 before comparisons?
I mean, shouldn’t the compiler assume an UInt32 “zero” instead of Integer “zero” since the first item in the comparison is an UInt32?
Dim result As Boolean = False
Dim number1 As UInt32
Dim aVariant As Variant
aVariant = 3521340885 // Larger than Int32 but within UInt32 range.
If aVariant >= 0 Then
result = True
Else
result = False
End If
// result = False at this point.
number1 = aVariant.UInt32Value
If number1 >= 0 Then
result = True
Else
result = False
End If
// result = False at this point.
number1 = 3521340885 // This time we enter the number directly.
If number1 >= 0 Then
result = True
Else
result = False
End If
// result = False at this point.
If number1 >= UInt32(0) Then
result = True
Else
result = False
End If
// result = True at this point.