Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!agate!bionet!apple!bloom-beacon!gatech!uflorida!haven!vrdxhq!bms-at!stuart From: stuart@bms-at.UUCP (Stuart Gathman) Newsgroups: comp.lang.c Subject: Re: Something IBM did right (RT division of negatives). Summary: An actual situation Message-ID: <124@bms-at.UUCP> Date: 8 Nov 88 16:44:03 GMT References: <3105@hubcap.UUCP> <34112@XAIT.XEROX.COM> <1700@dataio.Data-IO.COM> <11529@bellcore.bellcore.com> Organization: Business Management Systems, Inc., Fairfax, VA Lines: 13 In article <11529@bellcore.bellcore.com>, sjs@jcricket.ctt.bellcore.com (Stan Switzer) writes: > Anyone wishing to take up the other side of the argument must find an > example of an actual situation where having -1/2 yield -1 is useful. How about rounding by adding 1/2 and truncating (toward the smallest number, not zero)? Trunctating (-1)/2 to -1 is exactly the approach that does *not* require checking the sign when using arithmetic shifts. If you want logical shifts, use unsigned operands. -- Stuart D. Gathman <..!{vrdxhq|daitc}!bms-at!stuart>