Lloyd Miller wrote:
> This is a problem for 32 bit machines where long int implementation is
> 32 bits, like regular pc linux. It will overflow as soon as list_max >
[snip]
One simply needs to use the correct type.
$ uname -a
Linux Presario-1 2.6.10-1.771_FC2 #1 Mon Mar 28 00:50:14 EST 2005 i686
i686 i386 GNU/Linux
$ cat t.c
#include <stdio.h>
int main(void) {
printf("sizeof(unsigned long int) = %lu\n",
(unsigned long int)sizeof(unsigned long int));
printf("sizeof(unsigned long long int) = %lu\n",
(unsigned long int)sizeof(unsigned long long int));
return 0;
}
$ gcc -o t t.c
$ ./t
sizeof(unsigned long int) = 4
sizeof(unsigned long long int) = 8
Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!
_______________________________________________
Prime mailing list
[email protected]
http://hogranch.com/mailman/listinfo/prime