pack:
u32 x, y;
u64 v = ((u64)x) << 32 | y;
unpack:
x = (u32)((v & 0xFFFFFFFF00000000LL) >> 32);
y = (u32)(v & 0xFFFFFFFFLL);
More Related Contents:
- C++ quadratic equation using factorization
- Exotic architectures the standards committees care about
- Undefined reference to a static member
- Singleton: How should it be used
- Why use iterators instead of array indices?
- How to generate different random numbers in a loop in C++?
- Can’t use modulus on doubles?
- Why aren’t pointers initialized with NULL by default?
- Why do we need a pure virtual destructor in C++?
- What requirements must std::map key classes meet to be valid keys?
- Scope vs. Lifetime of Variable
- How to declare a templated struct/class as a friend?
- GCC ABI compatibility
- How to initialize a vector in C++ [duplicate]
- How do I get the type of a variable?
- C++ Header Files, Code Separation
- How to read-write into/from text file with comma separated values
- How to tell where a header file is included from?
- C++ Undefined Reference to vtable and inheritance
- Stopping the debugger when a NaN floating point number is produced
- std::shared_ptr thread safety explained
- Character pointers and integer pointers (++)
- What happens if ‘throw’ fails to allocate memory for exception object?
- What is the purpose of a declaration like int (x); or int (x) = 10;
- Weird MSC 8.0 error: “The value of ESP was not properly saved across a function call…”
- what is aggregate initialization
- Why does a function declaration with a const argument allow calling of a function with a non-const argument?
- Deduction guides and variadic class templates with variadic template constructors – mismatched argument pack lengths
- Seeking code stub generator (from header files) [closed]
- Find available network interfaces in C/C++? [closed]