Python compilers?

Harry George harry.g.george at boeing.com
Wed May 19 10:17:17 EDT 2004


Svein Ove Aas <svein+usenet01 at brage.info> writes:

> Mitja wrote:
> 
> > Thorsten Kampe <thorsten at thorstenkampe.de>
> > (news:1mklty031ke5a.dlg at thorstenkampe.de) wrote:
> >> * Tor Iver Wilhelmsen (2004-05-18 17:26 +0100)
> >>> Grant Edwards <grante at visi.com> writes:
> >>>
> >>>> Dude, didn't you take high-school math?  1/3 _is_ 0.33333...
> >>>
> >>> No, because at some point you will stop writing 3's, either out of
> >>> boredom, exhaustion or because you need to pee. At that instant, you
> >>> introduce a rounding error, making 3 * 1/3 = 0.99999999999... instead
> >>> of 1.0
> >>
> >> Must have been a long time since you went to school... 1/3 is
> >> /exactly/ 0.3...: http://mathworld.wolfram.com/RepeatingDecimal.html
> >>
> > 
> > Even worse....
> > 0.999999999999999999999... is exactly 1 :)
> 
> Only for infinite counts of '9', and computers don't do infinity.

We need to stop randomly mixing exact math with computer
implementations (and approximations) thereof.

"<digit><digit>..." is the accepted ASCII rendition of the repeating
overbar, and thus explicitly means "on to infinity".  0.99... exactly
equals 1.

If you want to shift the discussion to computer implementations then
that is a different story.  We can talk binary representations of
decimal fractions, and the value of rationals as a useful
representation.

But why not also complain that Python does not have a complete
representation of pi.  After all, the value of pi is known to well
beyond the IEEE 80-bit or 64-bit or whatever that an implementation
provides.  Even if we did mp math and did really long pi
representations, they would of course not be exact.  "e" isn't handled
completely either.  Why not complain about those?

We don't complain because the available values are "good enough".
IEEE 764 64-bit reals (internally handled as IEEE 764 80-bit) are
good-enough for most numerical needs.  I'll admit, the US debt needs
some extended precision :-( but most numerical analysis gets by with
epsilons under 1e-14.

Hey, while we are on the subject of exact representation, what's with
multithreading? My computer has only one CPU.  What's going on
here????  It's a lie, a LIE I tell you...



-- 
harry.g.george at boeing.com
6-6M21 BCA CompArch Design Engineering
Phone: (425) 342-0007



More information about the Python-list mailing list