I am working on a C++ program and I notice that
int main() {
printf("%bn", (uint64_t(1) << 37) - 1);
return 0;
}
returns
11111111111111111111111111111111
Exactly 32 bits. The same happens if I print the largest uint64_t
. What I mean is that the following code:
int main() {
printf("%bn", UINT64_MAX);
return 0;
}
returns
11111111111111111111111111111111
Exactly 32 bits again. I do not know what to do, why is this happening?
Thanks in advance.