OK, I'm trying to print the decimal/hexadecimal version of a relatively big unsigned long long
and the results I'm getting are quite weird...
The code :
unsigned long long a = 1llu<<63;
printf("decimal = %llu\n",a);
printf("hexadecimal = %llx\n",a);
The output :
decimal = 9223372036854775808
hexadecimal = 8000000000000000
Now, here's what :
- The hexadecimal output is correct.
- The decimal output is not (should be
9223372036854780000
)
Why's that happening? What am I doing wrong???