Re: Rounding with Div and Mod operators

Peter Wilson <peter.r.wilson@boeing.com>
20 May 1999 01:53:26 -0400

          From comp.compilers

Related articles
[7 earlier articles]
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)
Re: Rounding with Div and Mod operators sofkam@rpi.edu (1999-05-20)
Re: Rounding with Div and Mod operators drh@microsoft.com (Dave Hanson) (1999-05-20)
Re: Rounding with Div and Mod operators anton@mips.complang.tuwien.ac.at (1999-05-20)
Re: Rounding with Div and Mod operators peter.r.wilson@boeing.com (Peter Wilson) (1999-05-20)
Re: Rounding with Div and Mod operators mfinney@lynchburg.net (1999-05-21)
Re: Rounding with Div and Mod operators jmoore@softmoore.com (John I. Moore, Jr.) (1999-05-22)
Re: Rounding with Div and Mod operators lassehp@imv.au.dk (1999-05-22)
Re: Rounding with Div and Mod operators r_barton1@hotmail.com (Barton) (1999-05-22)
Re: Rounding with Div and Mod operators r_barton1@hotmail.com (Barton) (1999-05-27)
Re: Rounding with Div and Mod operators ucapjab@ucl.ac.uk (Jonathan Barker) (1999-05-27)
| List of all articles for this month |
From: Peter Wilson <peter.r.wilson@boeing.com>
Newsgroups: comp.compilers
Date: 20 May 1999 01:53:26 -0400
Organization: The Boeing Company
References: 99-05-039
Keywords: arithmetic

William Rayer wrote:
>
> I'm writing a compiler for a new language which is to include the
> integer division and integer remainder operators (div and mod). I have
> some questions about the way these operators do rounding with negative
> operands and would appreciate any feedback.


<snip>


        Knuth discusses these in Volume 1 (I don't have a copy to hand, but
I think its about a quarter of the way through).


      You might also want to look up: Raymond T. Boute, "The Euclidean
Definition of the Functions div and mod", ACM TOPLAS, 14(2):127-144,
April 1992.


        There is also some discussion on the implementation of these and
related mathematical operators in the ISO standard (ISO 10301-11:1994)
EXPRESS language at
http://www.nist.gov/sc4/wg_qc/wg11/express/tecpaper/expstdl.htm


Peter W.
peter.r.wilson@boeing.com


Post a followup to this message

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