From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 19 Apr 2010 20:26:26 +0200 From: tlaronde@polynum.com To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20100419182626.GA730@polynum.com> References: <20100419154317.GA726@polynum.com> <20100419161143.GA1377@shodan.homeunix.net> <20100419181533.GA2071@polynum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100419181533.GA2071@polynum.com> User-Agent: Mutt/1.4.2.3i Subject: Re: [9fans] Rounding off by one Topicbox-Message-UUID: 099d07a0-ead6-11e9-9d60-3106f5b1d025 On Mon, Apr 19, 2010 at 08:15:33PM +0200, tlaronde@polynum.com wrote: > > Thanks for the note. But I think I have found the problem: a division by > 2 supposed to be "floor" and that slips as (x + y) / 2: is there > anything that guarantees that the result shall be floor, ceil or > nearest? I find nothing in C89. Replying to myself: K&R, C, A7.6 Multiplicative operators. => The problem is with negatives for which there is only a general rule. -- Thierry Laronde http://www.kergis.com/ Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C