Author mark.dickinson
Recipients alexandre.vassalotti, amaury.forgeotdarc, christian.heimes, gvanrossum, mark.dickinson, nascheme, noam, preston, rhettinger, skip.montanaro, tim.peters
Date 2009-02-26.10:14:07
SpamBayes Score 1.60982e-15
Marked as misclassified No
Message-id <1235643249.83.0.881777018401.issue1580@psf.upfronthosting.co.za>
In-reply-to
Content
> The GNU library's float<->string routines are based on David Gay's. 
> Therefore you can compare those to Gay's originals

Sounds reasonable.

> (which accounts for the extreme length and complexity of Gay's code).

Looking at the code, I'm actually not seeing *extreme* complexity.
There are a lot of ifdefs for things that Python probably doesn't
care about (e.g., worrying about whether the inexact and underflow
flags get set or not;  hexadecimal floats, which Python already has
its own code for; weird rounding modes, ...).  There's some pretty
standard looking bignum integer stuff (it might even be possible to
substitute PyLong arithmetic for this bit).  There's lots of boring
material for things like parsing numeric strings.  The really
interesting part of the code is probably only a few hundred lines.

I think it looks feasible to adapt Gay's code for Python.  I'm not sure
I'd want to adapt it without understanding it fully, but actually that
looks quite feasible too.

The x87 control word stuff isn't really a big problem:  it can be dealt
with.  The bit I don't know how to do here is using the autoconf
machinery to figure out whether the x87 FPU exists and is in use on a
particular machine.  (I put in an autoconf test for x87-related double
rounding recently, which should be a pretty reliable indicator, but that
still fails if someone's already set 53-bit rounding precision...).

A side-note:  for x86/x86_64, we should really be enabling SSE2 by
default whenever possible (e.g., on all machines newer than Pentium 3).
History
Date User Action Args
2009-02-26 10:14:10mark.dickinsonsetrecipients: + mark.dickinson, gvanrossum, tim.peters, skip.montanaro, nascheme, rhettinger, amaury.forgeotdarc, christian.heimes, alexandre.vassalotti, noam, preston
2009-02-26 10:14:09mark.dickinsonsetmessageid: <1235643249.83.0.881777018401.issue1580@psf.upfronthosting.co.za>
2009-02-26 10:14:08mark.dickinsonlinkissue1580 messages
2009-02-26 10:14:07mark.dickinsoncreate