Re: Excel is faulty



On Sun, 4 Jan 2009 10:16:58 -0800 (PST), Mensanator
<mensanator@xxxxxxx> wrote:

On Jan 4, 11:00?am, David C. Ullrich <dullr...@xxxxxxxxxxx> wrote:
On Sun, 4 Jan 2009 08:42:25 -0800 (PST), Mensanator





<mensana...@xxxxxxx> wrote:
On Jan 4, 5:51?am, David C. Ullrich <dullr...@xxxxxxxxxxx> wrote:
On Sat, 3 Jan 2009 19:16:05 -0800 (PST), Mensanator

<mensana...@xxxxxxx> wrote:
On Jan 3, 7:22?pm, Ronald Bruck <br...@xxxxxxxxxxxx> wrote:
In article <q0qvl4hutkr77r9832mtssj5vo7896n...@xxxxxxx>, David C.

Ullrich <dullr...@xxxxxxxxxxx> wrote:
On Sat, 03 Jan 2009 11:58:09 -0800, Ronald Bruck <br...@xxxxxxxxxxxx>
wrote:

In article <bqpul4d1po3h36nia4r1rea28eacm1b...@xxxxxxx>, David C.
Ullrich <dullr...@xxxxxxxxxxx> wrote:

...

The problem is not with Excel - floating-point numbers
are simply not exact.
...

Of course, what you say is true.

But when I saw the thread, I guessed it was referring to Excel's
well-known eccentricity,

? ?-1^2 = 1

How would that lead to a 15-place value for pi that's
only correct in the first ten places?

...

Nothing. ?I was just remarking that Excel DOES make errors (at least,
**I** consider it so non-standard as to be an error),

It's NOT an error if it does what it was defined to do.

"defined", hmm. Is this behavior specified in the docs?

Whether or not it's documented, it would be implied
by the algorithms, wouldn't it?

That's an interesting point of view.

So is non-Euclidean geometry.

Do you consider that an error?

Non-Euclidean geometry doesn't imply that every
algorthm is correct.

1. Any behavior is ok as long it's "defined" to work that way.
2. The way the thing actually works counts as a "definition".

I have no idea how many decimals of pi are known.
Say it's N. Here's my algorithm to print the first N+1
digits of pi:

def PrintFirstNPlusOneDigitsOfPi():
? print 'rutabaga'

What I mean by "print the first N+1 digits of pi"
should be implicit.

And the result of which is inconsistent.

Huh? How is the result "inconsistent"?

Here's a better Excel example.

A1:=-1^2 evaluates to 1
A3:=-1 B3:=A3^2 evaluates to 1


Compare to Python:

print -1**2
-1
i = -1
print i**2
1

Why is the result of a literal inconsistent with that
of a variable?

Huh? There's a variable with the value -1 here,
and there's no literal -1 in sight.

It's due to precedence rules involving
the evaluation of a literal. If the programmer actually
wanted -1 squared, he should have enclosed it in
parentheses.

print (-1)**2
1

And one could always do
A1:=-(1^2)
in Excel to get -1 if that's what's intended. Using
parentheses in Excel to force correct precedence is
no different than using them in Python.

And I'll bet that doing things the "right" way creates
more bugs in Python programs than the "wrong" way does
in Excel. And the reason is because Excel is consistent
without parentheses and Python is not,

Your notion of consistency is very confused. There's
nothing the least bit "inconsistent" about what
Python's doing here.

even though
it's the "right" way.

David C. Ullrich

"Understanding Godel isn't about following his formal proof.
That would make a mockery of everything Godel was up to."
(John Jones, "My talk about Godel to the post-grads."
in sci.logic.)
.



Relevant Pages

  • Re: Excel is faulty
    ... by the algorithms, wouldn't it? ... Here's a better Excel example. ... Compare to Python: ... parentheses in Excel to force correct precedence is ...
    (sci.math)
  • Re: interfacing to a remote excel app
    ... Bram Stolk writes: ... > Google helped me find a nice package to interface python with MS Excel. ... this win32all extension seems to be specifically built for the ...
    (comp.lang.python)
  • Re: Printing forms and labels in Python
    ... send the results to excel. ... There are python modules that read and ... I thought the print drivers were there to ... a somewhat simplified common interface for regular programs like M$ ...
    (comp.lang.python)
  • Re: web crawler in python or C?
    ... Choose Python by default. ... architecture is about partitioning systems into ... Any or all of these hints may be irrelevant to a specific category of ... applications, but then, so can the hint about algorithms be. ...
    (comp.lang.python)
  • Re: Using Python for programming algorithms
    ... algorithms in question or is it going to be research ... If it's the former then Python seems like definitely ... CPU time is cheap and time spent programming is expensive." ... the preferred computer language amount scientists is ...
    (comp.lang.python)