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-01 11:23:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!oleane.net!oleane!proxad.net!news-hub.cableinet.net!blueyonder!btnet-peer!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail From: "chris.danx" Newsgroups: comp.lang.ada References: Subject: Re: Integers and Mathematical Correctness MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Thu, 1 Nov 2001 19:18:36 -0000 NNTP-Posting-Host: 62.253.10.89 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 1004642293 62.253.10.89 (Thu, 01 Nov 2001 19:18:13 GMT) NNTP-Posting-Date: Thu, 01 Nov 2001 19:18:13 GMT Organization: ntlworld News Service Xref: archiver1.google.com comp.lang.ada:15570 Date: 2001-11-01T19:18:36+00:00 List-Id: > >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! > > >For example -3/2 should be -2 not -1, with a remainder 1 not -1. > > Yes, the history of this goes back a long way, to ALGOL 60. The Europeans > (who were all mathematicians) were happy to define division for Reals and > were not particularly interested in integers. The Americans (who were all > programmers) saw a need for it, so the Europeans just said "OK, how do you > want to define it", and the Americans responded with the "obvious" and ONE > TRUE (i.e. FORTRAN) WAY. > > Then, of course, hardware got to be built the "wrong" way. In every > subsequent programming language (ALGOL 68, Pascal, Ada) the language > designers knew perfectly well that they were designing it wrong, but dared > not make the change. > I railed against this in 1983, and that is more or > less what I was told :-( . Interesting. We only learned that in programming languages (and primary school), technically division is incorrect the other day, and I was a bitty surprised. I don't really mind that it's "wrong", the package is just being written as a little distraction. I may never need it, but it's there if I do. Anyone wants it, let me know and I'll send it to you when I'm done. Bye, Chris