This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A "unsigned long long " problem


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]