[Python-Dev] Numerical robustness, IEEE etc.

Nick Coghlan ncoghlan at gmail.com
Mon Jun 19 06:29:59 CEST 2006

Nick Maclaren wrote:
> 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.

Python 2.4's decimal module is, in essence, a floating point emulator based on 
the General Decimal Arithmetic specification.

If you want floating point mathematics that doesn't have insane platform 
dependent behaviour, the decimal module is the recommended approach. By the 
time Python 2.6 rolls around, we will hopefully have an optimized version 
implemented in C (that's being worked on already).

That said, I'm not clear on exactly what changes you'd like to make to the 
binary floating point type, so I don't know if I think they're a good idea or 
not :)


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list