On Tue, 31 Jan 2012, Chuck Guzis wrote:
What about the numeric results of a shift on an int?
I am aware of
more than one system that handles ints as a special case of float;
i.e., the int may be 64 bits long, but it's composed of a 16 bit
exponent followed by a 48 bit mantissa. It would seem that shifting
one of those would produce some "interesting" results.
Similarly, sign-magnitude integer representations will give very
different results after a shift than will shifting the normal two/s
complement int.
K&R1-C can and will give different results depending on architecture.
ANSI-C will give consistent results, but not be available on all of the
platforms.