A "unsigned long long " problem

John Love-Jensen eljay@adobe.com
Mon Jul 31 16:35:00 GMT 2006


> i don't know why i cannot get 1<<63 in my c program.

Are your int data types 64-bits long?

The "1" in your "1<<63" is an int, not an unsigned long long.

If not, try this:

unsigned long long a = 1;
a <<= 63;

Or try this:

a = 1ULL << 63;

Either should work.

--Eljay



More information about the Gcc-help mailing list