@yahoogroups.com
Sent: Saturday, November 22, 2008 8:54 PM
Subject: [c-prog] integer promotions
If "The integer promotions preserve value including sign."
#include
int main (void) {
unsigned short int a;
unsigned long long int b, c;
a = -1;
b = (a*a);
c = ((unsigned int)a
On Sun, Nov 23, 2008 at 3:54 AM, Pedro Izecksohn <[EMAIL PROTECTED]> wrote:
> If "The integer promotions preserve value including sign."
>
> #include
>
> 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 = ((un
If "The integer promotions preserve value including sign."
#include
int main (void) {
unsigned short int a;
unsigned long long int b, c;
a = -1;
b = (a*a);
c = ((unsigned int)a*(unsigned int)a);
printf ("Why %llx != %llx ?\n", b, c);
return 0;
}