Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Adam <no@xxxxxxxx>
- Date: Wed, 26 Sep 2007 11:28:27 -0400
On Wed, 26 Sep 2007 05:50:55 -0500, Judson McClendon wrote:
"Adam" <no@xxxxxxxx> wrote:
Judson McClendon wrote:
"Adam" <no@xxxxxxxx> wrote:
Ideally, a computer is an infinite-precision machine.
Not if you're calculating a mortage payment, or handling money in
general.
In an infinite-precision machine, 0.1 is stored exactly.
And so is pi, but you can't write a check for pi, can you? :-)
Did I not address the root issue in your point about "handling money"?
Floats are in binary. There is no finite, exact representation for
0.1 in floats.
I made a blue-sky statement about an _ideal_ computer. You countered,
without explaining _why_, that such a tool wouldn't be appropriate for
"handling money". I addressed what seemed like an erroneous response
to my statement: rounding errors are a non-issue in such a
hypothetical machine.
Who in your "real world" wants to write a check for pi?
But there are cases where it would be helpful for a CAD program to use
an exact value for pi.
What you're suggesting is very simplistic.
And very practical in many cases. More complexity isn't always
better.
"Many" isn't equivalent to "all". Your suggestion was "all".
There can be only one default behavior. On balance, I think that
defaulting to double-precision variables is the best choice.
To do otherwise ingrains premature optimization -- which can yield
results counter to the interests of the user. I have given but two
examples where programmers chose the wrong data type for this user's
needs.
I'm not saying complexity is good, I'm saying your thinking is
too simplistic,
That statement is just way too broad and posturing.
and that the real world is often very complex,
more than your statements suggest that you realize.
Again with the smug dismissiveness.
I infer a selective, self-serving reading of what I have written.
Spreadsheets work with double-precision values anywhere there is a
fractional value. Are they too simplistic to be a useful tool in your
"real world"?
Many calculations,
for example, rely on entirely integer operations, and you would not
want or need higher precision in doing those.
For any reason other than speed or storage space?
Of course. In real-world situations
Again with the "real world".
you even have pecular things
like the specific precision of calculations being specified by a
statuary law.
I've actually seen this kind of thing.
There is no shortage of special cases.
It's not that you
can't do such calculations using infinite precision variables, but it
would be counter productive, and require more code. Why have
to explicity round or truncate every operation in a long and
complex algorithm, when simply being able to specify a fixed
precision would do it for you?
And when using True BASIC, that is sometimes both necessary and a
PITA.
I understand that data typing can be useful.
My contentions are:
1. Users generally don't want to have to worry about rounding errors.
In general, using double-precision values will cause rounding errors
to be less troublesome to users than single-precision.
2. Programmers can make unfounded assumptions -- or reflex reactions
-- when selecting a (or not bothering to override a default) data
type. The result can be of less value to the user than if the
language defaulted to using double-precision values.
3. A default to single-precision is an optimization strategy built
into a language as a service to the programmer -- not the user.
The "real-world" is
much more complex than your statements indicate you realize. :-)
That was hardly a helpful statement.
Apparently not. :-)
I was less direct than I might have been.
I'll rephrase:
Smug condescension is unbecoming.
Reserving a perception of _the_ "real world" to oneself is
off-putting.
A dismissive slam as a parting shot is a cheap shot.
Adam
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: news@xxxxxxxxxxxxxxx
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Judson McClendon
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- References:
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: ArarghMail709NOSPAM
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Auric__
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: carlg@xxxxxxxxxxxxxxxx
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Auric__
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Tom Lake
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Judson McClendon
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Adam
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Judson McClendon
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Adam
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- From: Judson McClendon
- Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- Prev by Date: Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- Next by Date: Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- Previous by thread: Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- Next by thread: Re: Chipmunk Basic arrays (Attn: Ron Nicholson)
- Index(es):