How does one construct a mask for the MS bit?
MLY.G.SHADES%MIT-OZ at MIT-MC.ARPA
MLY.G.SHADES%MIT-OZ at MIT-MC.ARPA
Fri Mar 8 23:17:30 AEST 1985
~(~(unsigned)0>>1) is not portable either i believe. as i
remember in k&r the >> operator can, and in some compilers does, allow
sign propagation. this is nominally a bug in the interpretation of
unsigned arithmetic but that is the way of life here in the big city.
i can't think of any way to guarantee a compiler time,
compiler generated, constant for the most significant bit that is
going to work on some of the more brain-damaged c compiler's around.
shades%mit-oz at mit-mc.arpa
More information about the Comp.lang.c
mailing list