Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-smoke.ARPA Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!brl-tgr!brl-smoke!ron From: ron@brl-smoke.ARPA (Ron Natalie ) Newsgroups: net.arch Subject: Re: Right shift vs. divide (change divide!) Message-ID: <605@brl-smoke.ARPA> Date: Wed, 15-Jan-86 12:26:37 EST Article-I.D.: brl-smok.605 Posted: Wed Jan 15 12:26:37 1986 Date-Received: Fri, 17-Jan-86 06:22:45 EST References: <124000005@ima.UUCP> <4772@alice.UUCP> <1016@turtlevax.UUCP> <32@calgary.UUCP> <285@mips.UUCP> <1032@mmintl.UUCP> Organization: Ballistic Research Lab Lines: 10 I don't know how this discussion managed to leak over from net.lang.c, but it is not a C issue. C makes no assumption on whether integer divides of negative operands truncates towards zero or -inf. If both operands are positive trucation is toward zero. C only guarantees that the integer divide and the modulo function are consistant with respect to each other, i.e. (a/b)*a + a%b equals a -Ron