[Python-ideas] Python Float Update

Andrew Barnert abarnert at yahoo.com
Tue Jun 2 07:15:35 CEST 2015

On Jun 1, 2015, at 21:47, random832 at fastmail.us wrote:
>> On Tue, Jun 2, 2015, at 00:31, Guido van Rossum wrote:
>> Or perhaps switch to decimal64 (
>> http://en.wikipedia.org/wiki/Decimal64_floating-point_format)? (Or its
>> bigger cousing, decimal128)
> Does anyone know if any common computer architectures have any hardware
> support for this?

IBM's RS/POWER architecture supports decimal32, 64, and 128. The PowerPC and Cell offshoots only support them in some models, not all. Is that common enough? (Is _anything_ common enough besides x86, x86_64, ARM7, ARM8, and various less-capable things like embedded 68k variants?)

> Are there any known good implementations for all the
> functions in math/cmath for these types?

Intel wrote a reference implementation for IEEE 754-2008 as part of the standardization process. And since then, they've focused on improvements geared at making it possible to write highly-optimized financial applications in C or C++ that run on x86_64 hardware. And I think it's BSD-licensed. It's available somewhere on netlib, but searching that repo is no fun on my phone (plus, most of Intel's code, you can't see the license or the detailed README until you unpack it...), so I'll leave it to someone else to find it.

Of course 754-2008 isn't necessarily identical to GDAS (which is what POWER implements, and Python's decimal module).

> Moving to a fixed-size floating point type does have the advantage of
> not requiring making all these decisions about environments and
> precision and potentially unbounded growth etc.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

More information about the Python-ideas mailing list