Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!wanginst!vaxine!encore!talcott!harvard!seismo!brl-tgr!tgr!MLY.G.SHADES%MIT-OZ@MIT-MC.ARPA From: MLY.G.SHADES%MIT-OZ@MIT-MC.ARPA Newsgroups: net.lang.c Subject: How does one construct a mask for the MS bit? Message-ID: <9068@brl-tgr.ARPA> Date: Fri, 8-Mar-85 08:17:30 EST Article-I.D.: brl-tgr.9068 Posted: Fri Mar 8 08:17:30 1985 Date-Received: Mon, 11-Mar-85 05:05:45 EST Sender: news@brl-tgr.ARPA Lines: 11 ~(~(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@mit-mc.arpa