On Sun, Nov 23, 2008 at 3:54 AM, Pedro Izecksohn <[EMAIL PROTECTED]> wrote:
> If "The integer promotions preserve value including sign."
>
> #include <stdio.h>
>
> int main (void) {
> unsigned short int a;
> unsigned long long int b, c;
> a = -1;
> b = (a*a);
Here you're multiplying two shorts.
> c = ((unsigned int)a*(unsigned int)a);
Here you're multiplying two ints.
Clearly, on your compiler, shorts are a different size to ints.
> printf ("Why %llx != %llx ?\n", b, c);
> return 0;
> }
--
PJH
http://shabbleland.myminicity.com/tra