This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16850] modulo - feature or bug?
- From: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Aug 2004 12:57:06 -0000
- Subject: [Bug c/16850] modulo - feature or bug?
- References: <20040801133528.16850.szak@gmx.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm at polyomino dot org dot uk 2004-08-22 12:57 -------
Subject: Re: modulo - feature or bug?
On Sun, 22 Aug 2004, szak at gmx dot de wrote:
> This is not a sufficient explanation since both modulo variants
> fulfil the equation
>
> integer(a/b)*b + a%b = a
You don't seem to have followed the quoted text. It defines the result of
integer division as truncation towards zero, and footnote 87 uses that
specific wording. This then implies particular behavior for modulo.
I'd have preferred proper division (i.e. truncation towards negative
infinity) and modulo, but the time to object was when C99 was being
written, not now; we just implement the standard requirements. I do not
know why <http://www.davros.org/c/public/pcuk0259.txt> was rejected by the
UK C Panel because I wasn't on the panel at the time.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16850