From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b61052ba3fdc8c26 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-01 06:45:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!crtntx1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!dfw-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3BE15D02.77C8C5A1@sparc01.ftw.rsc.raytheon.com> From: Wes Groleau Reply-To: wwgrol@sparc01.ftw.rsc.raytheon.com X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,es-MX,es,pt,fr-CA,fr MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Integers and Mathematical Correctness References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 01 Nov 2001 09:32:34 -0500 NNTP-Posting-Host: 151.168.144.162 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.raytheon.com 1004625155 151.168.144.162 (Thu, 01 Nov 2001 08:32:35 CST) NNTP-Posting-Date: Thu, 01 Nov 2001 08:32:35 CST Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:15533 Date: 2001-11-01T09:32:34-05:00 List-Id: "chris.danx" wrote: > To most this may seem insignificant but I'm more mathematically minded and I > just found something out. Many programming languages don't implement > division properly! In the case of Ada, "properly" means (-A)/B = -(A/b) = A/(-B) RM95 4.5.5(6-7) See also the notes on the next page (para. 23-30). If the compiler doesn't do this, send a bug report. If your c_integer package is going to do something else, I would advise the following comment at the beginning of it: -- NOTE: This package redefines integer division -- for the benefit of folks who think the -- RM definition is stupid. Do not expect -- division of these types to behave like -- other integer types! -- Wes Groleau http://freepages.rootsweb.com/~wgroleau