[New-bugs-announce] [issue9009] Improve quality of Python/dtoa.c

Mark Dickinson report at bugs.python.org
Wed Jun 16 16:00:48 CEST 2010

New submission from Mark Dickinson <dickinsm at gmail.com>:

I've opened this issue to track efforts to improve the quality of the Python/dtoa.c file, which provides Python's string-to-float and float-to-string conversions.

Particular issues in mind (non-exhaustive):

 - do a thorough review and test of _Py_dg_dtoa;  this has already
   been done for _Py_dg_strtod (issue 7632, issue 7743), and uncovered
   several problems, including a memory leak, some asserts that were
   triggered in debug mode, and many cases of wrong output.   

 - break out the parsing code from _Py_dg_strtod into a separate
   function, for clarity and maintainability (and possible re-use
   of the parsing code itself)

 - improve _Py_dg_strtod tests, by using contined-fractions to generate
   and test particularly difficult cases.

 - _Py_dg_strtod silently gives wrong results for huge inputs;  while
   not particular serious, this is easily avoidable.

 - improve API to rely on errno less.

 - some pieces of code are currently unused;  improve code coverage
   and tests to identify thoses pieces and remove them.

 - the current code is convoluted in places and hard to explain;
   at least some extra comments should be added.

 - try to make Python/dtoa.c as Python-agnostic as possible, so that
   the code can be reused in other projects where desired.

assignee: mark.dickinson
components: Interpreter Core
messages: 107923
nosy: eric.smith, mark.dickinson
priority: normal
severity: normal
status: open
title: Improve quality of Python/dtoa.c
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list