Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site bu-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!pyramid!ut-sally!seismo!harvard!bu-cs!bzs From: bzs@bu-cs.UUCP (Barry Shein) Newsgroups: net.lang.c Subject: Re: Right shift vs. divide Message-ID: <820@bu-cs.UUCP> Date: Mon, 23-Dec-85 17:35:13 EST Article-I.D.: bu-cs.820 Posted: Mon Dec 23 17:35:13 1985 Date-Received: Wed, 25-Dec-85 03:29:57 EST References: <974@brl-tgr.ARPA> Organization: Boston Univ Comp. Sci. Lines: 19 >BTW, is >> defined to be a sign-extended shift or a zero extended shift >and under what circumstances. > > Paul > Schauble @ MIT-Multics It should be controlled by the types of the things being shifted, not the operator: int foo, bar ; unsigned int thing, stuff ; foo = foo >> bar ; thing = thing >> stuff ; Expect the former to generate signed shift and the latter to generate an unsigned, casts are often useful to accomplish this. -Barry Shein, Boston University