I'm confused with the usage of 128-bit integer.
Please look at the test code:
uint128_t test_data = 0x00000000FFFFFFFF0101010101010101;
uint64_t test_data_h = test_data >> 64;
uint64_t test_data_l = test_data ;
printf("test_data 0x %016llx %016llx
", test_data_h, test_data_l);
I expect the test_data_h
to be 0x00000000FFFFFFFF, but the result is :
test data 0x 0000000000000000 0101010101010101
Why is this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…