Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site calgary.UUCP Path: utzoo!utcsri!ubc-vision!alberta!calgary!radford From: radford@calgary.UUCP (Radford Neal) Newsgroups: net.lang.c,net.arch Subject: Re: Integer division Message-ID: <114@calgary.UUCP> Date: Tue, 4-Feb-86 19:16:02 EST Article-I.D.: calgary.114 Posted: Tue Feb 4 19:16:02 1986 Date-Received: Wed, 5-Feb-86 09:23:13 EST References: <332@ism780c.UUCP> <11603@ucbvax.BERKELEY.EDU> Distribution: net Organization: University of Calgary, Calgary, Alberta Lines: 14 First, let me say that I'm firmly in the (-3)%2 == 1, (-3)/2 == (-2) camp. This is normally what one wants. There is one case, however, where the (-3)/2 == 3/(-2) == -(3/2) == -1 identity is usefull - writing software floating point routines. I offer this as a suggestion as to why the initial "mistake" was made. Now that we "all" have hardware floating point, can we change divide? Actually, I'd be satisfied if people would at least *document* what their divide operation does! (E.g. the MC68000 processor manual just says "the division is done using signed arithmetic"...) Radford Neal