Re: Rounding with Div and Mod operators

Norman Ramsey <nr@labrador.cs.virginia.edu>
16 May 1999 14:12:23 -0400

          From comp.compilers

Related articles
Rounding with Div and Mod operators william.rayer@virgin.net (William Rayer) (1999-05-09)
Re: Rounding with Div and Mod operators wclodius@aol.com (1999-05-16)
Re: Rounding with Div and Mod operators ucapjab@ucl.ac.uk (Jonathan Barker) (1999-05-16)
Re: Rounding with Div and Mod operators nr@labrador.cs.virginia.edu (Norman Ramsey) (1999-05-16)
Re: Rounding with Div and Mod operators guerby@acm.org (Laurent Guerby) (1999-05-16)
Re: Rounding with Div and Mod operators anton@mips.complang.tuwien.ac.at (1999-05-16)
Re: Rounding with Div and Mod operators Scott.Daniels@Acm.Org (Scott.David.Daniels) (1999-05-16)
Re: Rounding with Div and Mod operators cdg@nullstone.com (Christopher Glaeser) (1999-05-16)
Re: Rounding with Div and Mod operators johan.persson@mbox319.swipnet.se (Johan Persson) (1999-05-16)
Re: Rounding with Div and Mod operators genew@shuswap.net (1999-05-20)
[10 later articles]
| List of all articles for this month |
From: Norman Ramsey <nr@labrador.cs.virginia.edu>
Newsgroups: comp.compilers
Date: 16 May 1999 14:12:23 -0400
Organization: University of Virginia Computer Science
References: 99-05-039
Keywords: arithmetic, design, comment

William Rayer <william.rayer@virgin.net> wrote:
>What is interesting about this rule is there seem to be two ways of
>rounding that satisfy it when n or d are negative - either we round
>integers to the next lowest value or we round towards zero.


Some years ago, Knuth wrote a short screed arguing why round toward
minus infinity is better than round towards zero. It might even be in
Volume 2. You might also check the Modula-3 definition for arguments
about why the desginers of that lagnuages chose round towards minus
infinity.


If anybody can actually find the Knuth reference, I'd like to hear
about it --- I seem to wind up producing it once a year, adn I'd love
to give people a more precise pointer.


Norman
[I looked, if it's in Vol 2, it's well hidden. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.