Result I am getting:Code:Primitive<uint64_t> full = 0xBBBBBBBBCCCCCCCC; Primitive<uint64_t> first = 0x0000000000000000; first = (full & 0xFFFFFFFE00000000); std::cout << "FIRST: " << first << std::endl;
Which is 0x12C5F92C33333333 .
I was expecting 0xBBBBBBBA00000000 .
Looks like the problem is with initialising 'full'.
For this code:
I also get the same result:Code:Primitive<uint64_t> full = 0xBBBBBBBBCCCCCCCCULL; unsigned long long f = 0xBBBBBBBBCCCCCCCCULL; std::cout << "f: " << f << std::endl; std::cout << "full: " << full << std::endl;
Was a problem with std::cout - was printing numbers as negative for some reason.
Problem solved now.