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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 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 09:08:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Integers and Mathematical Correctness Date: Thu, 1 Nov 2001 11:20:45 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9rrsou$bl1$1@nh.pace.co.uk> References: <1f26o22.1xfvwvo111pfi4N%csampson@inetworld.net> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1004631646 11937 136.170.200.133 (1 Nov 2001 16:20:46 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 1 Nov 2001 16:20:46 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:15552 Date: 2001-11-01T16:20:46+00:00 List-Id: Just because I think the Ada attributes for math (and, of course, other stuff) are really cool things to have, I thought I'd mention: ARM Annex K wherein you can find S'Ceiling and S'Floor. They apply to floating point types, but they might be interesting in this context anyway. I don't know of other languages providing so many handy mathematical attributes that let you develop code for portability and/or precise behavior. Its one more reason why Ada ought to be of interest to those doing mathematical/scientific programming. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Charles Sampson" wrote in message news:1f26o22.1xfvwvo111pfi4N%csampson@inetworld.net... > chris.danx wrote: > > I'm trying to implement integer division the "proper" way (according to > > Euclid), just for fun (and to provide a mathematically correct package for > > anyone who gets annoyed by this). > > I'm not sure how you determined that the "proper" definition of > integer division is to return floor (a/b), where "/" is mathematical > division. The definition used by most programming languages preserves > the very useful property -(a/b) = (-a)/b = a/(-b), where this time "/" > represents integer division.