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-Thread: a07f3367d7,181acb4d59c58e23 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!news-peer.in.tum.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sun, 17 Oct 2010 20:32:10 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: evaluation of named numbers References: <2304722c-027d-42f6-a45d-5a7646c35cf6@t8g2000yqk.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4cbb412a$0$6974$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 17 Oct 2010 20:32:10 CEST NNTP-Posting-Host: 5328207b.newsspool4.arcor-online.net X-Trace: DXC=m\CX@PEP7SPV;Ef1`Jk54\4IUKejVXAXS51WZVmR[LaS;WO]IJXQ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:15564 Date: 2010-10-17T20:32:10+02:00 List-Id: On 10/17/10 6:05 PM, Robert A Duff wrote: > It's annoying that Ada (and lots of other languages) use > a mathematically wrong definition of division, but that's > the way it is. It annoys me no end when language designers refuse to think of the computer number as a mathematical entity in its own right! :-) These numbers have their own rules and their own glory. Computable entities of the kind are used every day, everywhere. They make rockets explode or deliver satellites. They are important. So they are well worth their special mathematical structure awareness, both during language design and when the programs are written. Our brains connect "/" etc. to notions we have about a very different kind of number. Alas, the result of thinking "school math style" about computer numbers is a bag of problems, as we see. Therefore, I prefer adapting programming expressions to the rules of computer numbers, moving focus away from the "math numbers fallacy". It won't hurt you. (Playing with syntax rules, I'd not use "/" for integers, since it invites thinking of "/" as division "as we know it". I believe that Pascal's "div" operator has made many aware of "division with truncation" not being the same as "division". Along with this, however, I'd force the use of parentheses with "mathematical" operators, simply because these little changes will make many math related problems disappear. That's because they appear more visibly in source text, as a reminder that you are requesting computer number mathematics.) Georg