Skip to content

Instantly share code, notes, and snippets.

@pmichna
Created June 13, 2013 17:31
Show Gist options
  • Save pmichna/5775623 to your computer and use it in GitHub Desktop.
Save pmichna/5775623 to your computer and use it in GitHub Desktop.
uint32_t get_lower_32_bits(uint64_t i)
{
return (uint32_t) i;
}
uint32_t get_higher_32_bits(uint64_t i)
{
return (uint32_t) (i >> 32);
}
uint64_t combine_to_uint64(uint32_t lower, uint32_t higher)
{
uint64_t result;
result = (uint64_t) higher;
result = (result << 32);
result = result | (uint64_t) lower;
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment