On Sun, Feb 19, 2017 at 04:44:43PM +0100, Chris Pezley wrote: > int main( void ) > { > int32_t high_part; > int32_t low_part; > int64_t together; > > const int64_t id = 0xAAAAAAAAAAAA; > > high_part = id >> 32; > low_part = id & 0xFFFFFFFF; > together = (int64_t)high_part << 32 | low_part; The way you write it, low_part is implicitly cast to int64_t. It is signed and negative, so it gets 1 bits in the top half. Segher