This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients alexandre.vassalotti, amaury.forgeotdarc, christian.heimes, gvanrossum, mark.dickinson, nascheme, noam, preston, rhettinger, tim.peters
Date 2009-03-05.11:49:29
SpamBayes Score 4.8089563e-09
Marked as misclassified No
Message-id <1236253773.61.0.563706194464.issue1580@psf.upfronthosting.co.za>
In-reply-to
Content
Would it be acceptable to use shorter float repr only on big-endian and 
little-endian IEEE 754 platforms, and use the full 17-digit repr on other 
platforms?  This would greatly simplify the adaptation and testing of 
Gay's code.

Notable platforms that would still have long repr under this scheme, in
order of decreasing significance:

  - IBM zSeries mainframes when using their hexadecimal FPU (recent
    models also have IEEE 754 floating-point, and Linux on zSeries
    uses that in preference to the hex floating-point).
  - ARM, Old ABI (uses a mixed-endian IEEE 754 format;  a newer set
    of ABIs appeared recently that use big or little-endian IEEE 754)
  - Cray SV1 (introduced 1998) and earlier Cray machines.  Gay's code
    doesn't support the Cray floating-point format anyway.  I believe
    that newer Crays (e.g., the X1, introduced in 2003) use IEEE
    floating-point.
  - VAX machines, using VAX D and G floating-point formats.  More recent
    Alpha machines support IEEE 754 floats as well.
  - many ancient machines with weird and wonderful floating-point
    schemes

As far as I can determine, apart from the IBM machines described above all 
new platforms nowadays use an IEEE 754 double format.  Sometimes IEEE 
arithmetic is only emulated in software;  often there are shortcuts taken 
with respect to NaNs and underflow, but in all cases the underlying format 
is still IEEE 754, so Gay's code should work.  Gay's careful to avoid 
problems with machines that flush underflow to zero, for example.

Gay's code only actually supports 3 floating-point formats: IEEE 754 (big 
and little-endian), IBM hex format and VAX D floating-point format.  There 
are actually (at least?) two variants of D floating-point:  the version 
used on VAX, which has a 56-bit mantissa and an 8-bit exponent, and the 
Alpha version, which only has a 53-bit mantissa (but still only an 8-bit 
exponent);  Gay's code only supports the former.

I'm quite convinced that the VAX stuff in Gay's code is not worth much to 
us, so really the only question is whether it's worth keeping the code to 
support IBM hexadecimal floating-point.  Given the difficulty of testing 
this code and the (significant but not overwhelming) extra complexity it 
adds, I'd like to remove it.
History
Date User Action Args
2009-03-05 11:49:34mark.dickinsonsetrecipients: + mark.dickinson, gvanrossum, tim.peters, nascheme, rhettinger, amaury.forgeotdarc, christian.heimes, alexandre.vassalotti, noam, preston
2009-03-05 11:49:33mark.dickinsonsetmessageid: <1236253773.61.0.563706194464.issue1580@psf.upfronthosting.co.za>
2009-03-05 11:49:31mark.dickinsonlinkissue1580 messages
2009-03-05 11:49:29mark.dickinsoncreate