]> granicus.if.org Git - python/commit
Proactive reliability fix for broken FPUs: The base conversion functions
authorStefan Krah <skrah@bytereef.org>
Sat, 30 Jun 2012 16:05:33 +0000 (18:05 +0200)
committerStefan Krah <skrah@bytereef.org>
Sat, 30 Jun 2012 16:05:33 +0000 (18:05 +0200)
commitc35a8e5c98c4ae43027c57e679da62fa9e132060
treef6b6f6c401c9e684470800581b61650936290c6e
parente38c98f97400fcaa5d7bf3f09ae5ab0c7e1e1dda
Proactive reliability fix for broken FPUs: The base conversion functions
use log10() to calculate the size of the output array. The current code
has been tested on x86/amd64 (and to a lesser extent on qemu-mips qemu-sparc)
and produces sufficiently large values for all inputs tested so far (coefficient
sizes of 10**18 - 1 are hard to test exhaustively).

The new code does not rely on the correctness of log10() and resizes
the output arrays if the allocated space is insufficient.
Modules/_decimal/_decimal.c
Modules/_decimal/libmpdec/basearith.c
Modules/_decimal/libmpdec/basearith.h
Modules/_decimal/libmpdec/mpdecimal.c
Modules/_decimal/libmpdec/mpdecimal.h