comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de>
Subject: Re: evaluation of named numbers
Date: Sun, 17 Oct 2010 20:32:10 +0200
Date: 2010-10-17T20:32:10+02:00	[thread overview]
Message-ID: <4cbb412a$0$6974$9b4e6d93@newsspool4.arcor-online.net> (raw)
In-Reply-To: <wcc39s4pzyo.fsf@shell01.TheWorld.com>

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



  reply	other threads:[~2010-10-17 18:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17 15:01 evaluation of named numbers Rolf
2010-10-17 15:28 ` Vinzent Hoefler
2010-10-17 16:05 ` Robert A Duff
2010-10-17 18:32   ` Georg Bauhaus [this message]
2010-10-17 18:57 ` Nasser M. Abbasi
2010-10-17 22:30 ` anon
2010-10-17 22:32 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox