Precision issue

Stephen Horne $$$$$$$$$$$$$$$$$ at $$$$$$$$$$$$$$$$$$$$.co.uk
Mon Oct 13 12:50:36 EDT 2003


On 13 Oct 2003 08:44:17 -0700, Paul Rubin
<http://phr.cx@NOSPAM.invalid> wrote:

>"Tim Peters" <tim.one at comcast.net> writes:
>> It's vital for marshal to try to reproduce floats across platforms.  It does
>> OK at that now, but I think it would be better for marshal to move to a
>> binary format.  That's got problems of its own, due to compatibility
>> hassles.
>
>If the binary format is ieee754, that should be enough for
>compatibility between all ieee754 machines (adjusting for endianness,
>right)?
>
>Some library code to convert ieee754 to native format on non-ieee754
>machines might be needed, but surely it wouldn't cause worse problems
>than the existing decimal encoding already does.  (Do you know for a
>fact that anyone is actually using python floats on any machines like
>that these days anyway?  I can imagine a few vaxes still running, but
>the cray-1's have to all be gone by now).

My guess would be that it's not just a hardware issue.

There may still be software around that is doing real arithmetic
without using hardware floats. Possible examples may include software
compiled on old PC compilers, before co-processors were always
available - I certainly remember Turbo BASIC having a different binary
float representation than some common BASIC interpreter (GW BASIC?)
years ago.

Basically, people may be using Python in contexts where interacting
with old systems is important - and interacting with old systems can
throw up some interesting surprises.


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list