This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/16850] modulo - feature or bug?


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]