Claus-Justus Heine <[EMAIL PROTECTED]> writes:

> (signed long) = (signed int) x (unsigned int)
>
> Surprisingly the sign is not promoted in this case:
>
> a = -1 * 20, then a = 0x0000 0000 ffff ffec
>
> IMHO, this is a bug.

No, it isn't. In this context, -1 is converted to unsigned, yielding
0xffffffff. Then 0xffffffff * 20 is calculated and truncated to
unsigned, and then zero extended to 64 bit.

-- 
        Falk

Reply via email to