Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22070

gcc 7.3 128-bit unsigned integer operation

$
0
0

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\n", 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?


Viewing all articles
Browse latest Browse all 22070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>