conversion of short to unsigned it

Norman Diamond ndiamond at watdaisy.UUCP
Tue Mar 19 13:42:35 AEST 1985


> What's the proper conversion of a short to an unsigned int?
> In otherwords should the conversion be a sign extension of the
> short treated as an unsigned int after sign extension, or should
> there be no sign extension?

(int) (unsigned) x   does not necessarily equal   (unsigned) (int) x

-- 

   Norman Diamond

UUCP:  {decvax|utzoo|ihnp4|allegra}!watmath!watdaisy!ndiamond
CSNET: ndiamond%watdaisy at waterloo.csnet
ARPA:  ndiamond%watdaisy%waterloo.csnet at csnet-relay.arpa

"Opinions are those of the keyboard, and do not reflect on me or higher-ups."



More information about the Comp.lang.c mailing list