From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@cse.psu.edu
Subject: [9fans] c99 div and mod round toward zero
Date: Sat, 15 Apr 2006 20:53:58 -0500 [thread overview]
Message-ID: <f49d2220962483d10045ee01342c29e6@quanstro.net> (raw)
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 <u.h>
#include <libc.h>
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
next reply other threads:[~2006-04-16 1:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-16 1:53 erik quanstrom [this message]
2006-04-16 3:15 ` Russ Cox
2006-04-16 3:56 ` geoff
2006-04-16 5:33 ` Russ Cox
2006-04-16 3:48 dmr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f49d2220962483d10045ee01342c29e6@quanstro.net \
--to=quanstro@quanstro.net \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).