From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <63434bbd31db4fd6acf8dde119f66db8@plan9.bell-labs.com> Date: Sat, 15 Apr 2006 23:48:55 -0400 From: dmr@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] c99 div and mod round toward zero MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 36f18fdc-ead1-11e9-9d60-3106f5b1d025 > is this [rounding to 0] fixed, or an archiitechture-dependent thing? i don't > have a way of checking anything else. In C89 it was allowed to vary by architecture (subject to obvious consistency constraints). In C99 the result is well-determined, and does round to 0. This is consistent with the usual math convention, but in fact not necessarily best (e.g. for graphics, as Rob has pointed out). Dennis