I'm running into a problem where VB6 gives me an overflow. I'm using bitwise operations to find the state of an individual bit, but the statement in particular is the final line of:
Dim a As Double
Dim b As Double
Dim c As Double
a = 2 ^ 31
b = 0
c = b And a
And the error occurs on that last line, an overflow. I'm under the impression the And operator is limited to 4 bytes (long in VB6) and therefore overflows with
a = 2 ^ 31
which is greater than the upper limit of a long. Can someone confirm/clarify/solve this problem? Again, I just need to find the state of an individual bit. (This also occurs if I make a, b, and c Currency, which is also 8 bytes but stored as an integer types. I need 44 bits, so I defaulted to the 8-byte data types)
(I'm new to bit manipulation and VB in general, and StackOverflow as well so forgive any mistakes I may have made)