title: VB6 Bitwise And w/ 8-Byte Data Type
body: <p>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:  </p>
  
  <p><code>Dim a As Double
  Dim b As Double
  Dim c As Double
  a = 2 ^ 31
  b = 0
  c = b And a</code>    </p>
  
  <p>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</p>
  
  <blockquote>
    <p>a = 2 ^ 31</p>
  </blockquote>
  
  <p>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)</p>
  
  <p>(I'm new to bit manipulation and VB in general, and StackOverflow as well so forgive any mistakes I may have made)</p>