I have a little question:
The long -2147483648 could be represented by 0x80000000 and fit in 32 bits, but is convertet to long long by pelles c. Why?
czerny
I think we need a little more detail... Converted where?
#include <stdio.h>
int main(void)
{
if ((-2147483648 & 0xffffffff) > 0) printf("positive\n");
return 0;
}
or try to print it. The compiler wants %llx
#include <stdio.h>
int main(void)
{
printf("%llx\n",-2147483648);
return 0;
}
czerny
Try it with -2147483647 and see what it does...
It might be trying to prevent an overflow.
#include <stdio.h>
int main(void)
{
printf("%d\n",-2147483648);
printf("%u\n",-2147483648);
printf("%x\n",-2147483648);
printf("%llx\n",-2147483648);
return 0;
}
QuoteIt might be trying to prevent an overflow.
???
czerny