IsUnsigned() function (retiring injured)
Peter da Silva
peter at ficc.ferranti.com
Tue Aug 7 05:57:44 AEST 1990
In article <25836 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
> Actually, the rule is fairly easy to state: `In ANSI C, when an
> unsigned type is promoted% to some other type, it becomes signed
> (without changing value) if and only if the new type is actually
> bigger.' In practise, this means that you have to know whether
> sizeof(short) < sizeof(int) and whether sizeof(char) < sizeof(int).
What is the rationale for this? There's probably a good reason, but at
first glance it seems counterintuitive.
--
Peter da Silva. `-_-'
+1 713 274 5180. 'U`
<peter at ficc.ferranti.com>
More information about the Comp.lang.c
mailing list