From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Sat, 15 Apr 2006 20:53:58 -0500 To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] c99 div and mod round toward zero Topicbox-Message-UUID: 36e21aca-ead1-11e9-9d60-3106f5b1d025 according to /sys/src/cmd/cc/c99: Not done (yet?): [...] 25. Division and mod truncate toward zero. on 8c this works as expected. i.e. ; cat mod.c #include #include void main(void) { fprint(2, "-22/7 = %d\n", -22/7); fprint(2, "-22%%7 = %d\n", -22%7); } ; 8c mod.c && 8l mod.8 && 8.out -22 7 = -3 -22 % 7 = -1 is this fixed, or an archiitechture-dependent thing? i don't have a way of checking anything else. - erik