RE: [Dev-C++] Can I handle 64 bits with unsigned long long int ?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@at...> - 2003-04-06 18:10:34
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Daniel K. O.
> Sent: Sunday, April 06, 2003 8:05 PM
> To: 'Dev-C++ -Users-List'
> Subject: RES: [Dev-C++] Can I handle 64 bits with unsigned
> long long int ?
>
>
>
>
>
>
>
> > Of course it does. In fact I compiled that code with:
> >
> >
> > C:\c>gcc temp.c -o temp
> >
> > C:\c>temp
> > Maximum value of unsigned long long: 4294967295
> >
>
>
> But it should be 18446744073709551615 (2^64 - 1).
> What I mean is that the %llu doesn't handle the 64-bit
> integer, only the
> first word.
Obviously MINGW's unsigned long long isn't 64 bit or there is serious
compiler bug. An equivalent code:
#include <stdio.h>
int main(void)
{
printf ("Maximum value of unsigned long long: %llu\n", (unsigned long
long)-1);
getchar();
}
It still produces:
C:\c>temp
Maximum value of unsigned long long: 4294967295
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
|