This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: A "unsigned long long " problem
- From: John Love-Jensen <eljay at adobe dot com>
- To: bacmoz <wg_nwpu at yahoo dot com dot cn>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 31 Jul 2006 11:35:26 -0500
- Subject: 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