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,LOTS_OF_MONEY 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 09:15:12 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!pln-w!extra.newsguy.com!lotsanews.com!peernews.mcc.ac.uk!cs.man.ac.uk!clerew!chl From: chl@clw.cs.man.ac.uk (Charles Lindsey) Subject: Re: Integers and Mathematical Correctness Message-ID: X-Newsreader: NN version 6.5.2 (NOV) References: Date: Thu, 1 Nov 2001 16:11:06 GMT Xref: archiver1.google.com comp.lang.ada:15553 Date: 2001-11-01T16:11:06+00:00 List-Id: In "chris.danx" writes: >Hi, >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 :-( . -- Charles H. Lindsey ---------At Home, doing my own thing------------------------ Tel: +44 161 436 6131 Fax: +44 161 436 6133 Web: http://www.cs.man.ac.uk/~chl Email: chl@clw.cs.man.ac.uk Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K. PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5