Re: Rounding with Div and Mod operators

"Dave Hanson" <drh@microsoft.com>
20 May 1999 01:47:33 -0400

          From comp.compilers

Related articles
[5 earlier articles]
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)
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)
[2 later articles]
| List of all articles for this month |
From: "Dave Hanson" <drh@microsoft.com>
Newsgroups: comp.compilers
Date: 20 May 1999 01:47:33 -0400
Organization: Microsoft Corp.
References: 99-05-039 99-05-042
Keywords: arithmetic

Wclodius <wclodius@aol.com> wrote in message news:99-05-042@comp.compilers...
> << Subject: Rounding with Div and Mod operators
> From: "William Rayer" <william.rayer@virgin.net>
> Date: Sun, May 9, 1999 4:47 PM
>
> 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.


Modula-3 has the best and most concise definition (i.e., the one
mathematicians prefer) I've seen; visit
http://www.research.digital.com/SRC/m3defn/html/arithmetic.html for
details. There's a C implementation of these semantics in Chap. 2 of
my book, C Interfaces and Implementations (see
http://www.cs.princeton.edu/software/cii/)


dave hanson


Post a followup to this message

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