How to offset> = 32 bits in uint64_t?
1 answer
How to shift> = 32 bits in
uint64_t
?
If your compiler supports long long
:
boost::uint64_t x = 1LL << 32;
Otherwise:
boost::uint64_t x = boost::uint64_t(1) << 32;
Shouldn't this be accurate since the type is 64 bits?
Not. Even if it x
's 64 bits, 1
no. 1
- 32 bits. How you use the result does not affect how the result is created.
+10
source to share