[Python-Dev] Expert floats

Andrew Koenig ark-mlist at att.net
Wed Mar 31 11:04:12 EST 2004


> > You argued against applying the Scheme rules because that would make
> > marshalling less accurate when the unmarshalling is done on a machine
> > with longer floats.


> I said the 754 committee had that objection.

OK, but either that objection is relevant for Python or it isn't.

> This was discussed on David Hough's numeric-interest mailing list at the
> time Clinger and Steele/White published their float<->string papers, and
> "phooey" was the consensus of the 754 folks on the mailing list at the
> time. 

Interesting -- I didn't know that.  But it would make sense -- they're
probably more interested in cross-platform computational accuracy than they
are in convenience for casual uses.

> I personally don't think decimal strings are a sane way to transport
> binary floats regardless of rounding gimmicks.

Fair enough.

> > But on such a machine, 17 digits won't be good enough anyway.


> Doesn't change that 17 digits gets closer then shortest-possible:  the art
> of binary fp is about reducing error, not generally about eliminating
> error.
> Shortest-possible does go against the spirit of 754 in that respect.

That's a fair criticism.  On the other hand, maybe ?!ng is right about the
desirable properties of display for people being different from those for
marshalling/unmarshalling.

> > That's what I meant.  Rather than 0.47 from exact, I meant 0.47 from
> > the best possible.

> Well, you originally said that in response to my saying that the standard
> doesn't require perfect rounding (and it doesn't), and that the standard
> has different accuracy requirements for different inputs (and it does).
> So now I'm left wondering what your original "I thought that ..." was
> trying to get across.

I don't remember; sorry.

> > Hey, I know some people who write C programs that don't rely on the
> > platform C libraries for anything :-)

> Python would love to grab their I/O implementation then <0.8 wink>.

http://www.research.att.com/sw/tools/sfio/

I think the licensing terms are compatible with Python, if you're serious.




More information about the Python-Dev mailing list