[Python-Dev] Numerical robustness, IEEE etc.

Nick Maclaren nmm1 at cus.cam.ac.uk
Thu Jun 15 23:21:17 CEST 2006

As I have posted to comp.lang.python, I am not happy with Python's
numerical robustness - because it basically propagates the 'features'
of IEEE 754 and (worse) C99.  Yes, it's better, but I would like to
make it a LOT better.  I already have a more robust version of 2.4.2,
but there are some problems, technical and political.  I should
appreciate advice.

1) Should I start off by developing a testing version, to give people
a chance to scream at me, or write a PEP?  Because I am no Python
development expert, the former would help to educate me into its
conventions, technical and political.

2) Because some people are dearly attached to the current behaviour,
warts and all, and there is a genuine quandary of whether the 'right'
behaviour is trap-and-diagnose, propagate-NaN or whatever-IEEE-754R-
finally-specifies (let's ignore C99 and Java as beyond redemption),
there might well need to be options.  These can obviously be done by
a command-line option, an environment variable or a float method.
There are reasons to disfavour the last, but all are possible.  Which
is the most Pythonesque approach?

3) I am rather puzzled by the source control mechanism.  Are commit
privileges needed to start a project like this in the main tree?
Note that I am thinking of starting a test subtree only.

4) Is there a Python hacking document?  Specifically, if I want to
add a new method to a built-in type, is there any guide on where to

5) I am NOT offering to write a full floating-point emulator, though
it would be easy enough and could provide repeatable, robust results.
"Easy" does not mean "quick" :-(  Maybe when I retire.  Incidentally,
experience from times of yore is that emulated floating-point would
be fast enough that few, if any, Python users would notice.

Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1 at cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679

More information about the Python-Dev mailing list