Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site mips.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!glacier!mips!hansen From: hansen@mips.UUCP (Craig Hansen) Newsgroups: net.lang.c,net.arch,net.math Subject: Re: Integer division Message-ID: <315@mips.UUCP> Date: Wed, 5-Feb-86 12:59:38 EST Article-I.D.: mips.315 Posted: Wed Feb 5 12:59:38 1986 Date-Received: Fri, 7-Feb-86 20:48:55 EST References: <11603@ucbvax.BERKELEY.EDU> <4917@alice.UUCP> <11671@ucbvax.BERKELEY.EDU> <1671@utah-gr.UUCP> Organization: MIPS Computer Systems, Mountain View, CA Lines: 17 Xref: watmath net.lang.c:7781 net.arch:2472 net.math:2792 I assume that everyone else is as sick and tired of seeing this dead horse beaten as I am, but I find a point still unstated. Several people have asked for mathematical reasons for choosing integer division with rounding to - infinity rather than zero. I submit the following: If you wish to compute an approximation to a/b to the NEAREST integer, when a/b is rounded to minus infinity, you can use (a+a+b)/(b+b). I can think of no expression except those that involve conditionals for which this can be done when a/b is rounded to zero. Craig Hansen MIPS Computer Systems ...decvax!decwrl!mips!hansen