#676 A signed result from an unsigned operation

closed-rejected
5
2013-05-25
2004-01-11
No

typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long LONG;

void main(void)
{
BYTE Iratio; LONG apu;
Iratio=0xc0;
apu=(Iratio*Iratio)>>2;
printf("%x\n", apu);
}

Shouldn't "apu" be 0x00002400 instead of 0xffffe400 ?

sdcc-version:
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51
/ds400/hc08 2.3.7 (Jan 11 2004) (MINGW32)

Discussion

  • Bernhard Held

    Bernhard Held - 2004-01-11
    • milestone: --> non_bugs
    • assigned_to: nobody --> bernhardheld
    • status: open --> closed-rejected
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks