G
Glen Able
The behaviour of << and >> arithmetic operators (under VC++6, x86) seems
rather odd to me.
Shifts at runtime seem to only use the bottom 5 bits of the shift amount (an
x86 issue I suppose), but the compile time evaluation will do as you'd
expect (so i << 32 is 0, rather than i).
Also compile time shifts do some weird clamping where, e.g.
-99 >> 20 is -1
and -99 >> -1 is -1
Does any of this seem acceptable behaviour (particularly the fact that a
simple arithmetic operation can have different results and compile and
runtime) ?
thanks.
rather odd to me.
Shifts at runtime seem to only use the bottom 5 bits of the shift amount (an
x86 issue I suppose), but the compile time evaluation will do as you'd
expect (so i << 32 is 0, rather than i).
Also compile time shifts do some weird clamping where, e.g.
-99 >> 20 is -1
and -99 >> -1 is -1
Does any of this seem acceptable behaviour (particularly the fact that a
simple arithmetic operation can have different results and compile and
runtime) ?
thanks.