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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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-03 06:57:59 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!csampson From: csampson@inetworld.net (Charles Sampson) Newsgroups: comp.lang.ada Subject: Re: Integers and Mathematical Correctness Date: Sat, 3 Nov 2001 06:57:27 -0800 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <1f2ab2b.192wu41hlgy2N%csampson@inetworld.net> References: <1f26o22.1xfvwvo111pfi4N%csampson@inetworld.net> <_lfE7.52002$a14.6154112@news6-win.server.ntlworld.com> User-Agent: MacSOUP/2.4.6 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:15737 Date: 2001-11-03T06:57:27-08:00 List-Id: chris.danx wrote: > According to Euclid, the "division algorithm" (which isn't an algorithm) > asserts that for a/b > > a = kb + r > > where r >= 0 > k <- Integers Disclaimer: Working from long dormant memory. Yes, this is also the definition used when you develop numbers be- ginning with the Peano postulates (with the correction, noted elsewhere, of 0 <= r < b). However, in both cases only non-negative integers are being considered. So the claim "according to Euclid" is incorrect in the case of negative integers. The mathematical issue is, how do you extend the definition of di- vision to include negative integers? The extension I'm familiar with is the same as the definition used in most programming languages, including Ada. I'm not even sure what the mathematical implications would be if you adopted the above "Euclid definition" of a/b if a < 0 and b > 0. I suspect that things would become very sloppy along the way. They cer- tainly would be in programming. Charlie