This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年04月27日 20:50 by mark.dickinson, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue5859_stage1.patch | mark.dickinson, 2009年05月01日 10:37 | patch to dynamically allocate buffers for float formatting | ||
| issue5859_stage2.patch | mark.dickinson, 2009年05月01日 13:15 | |||
| Messages (6) | |||
|---|---|---|---|
| msg86693 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2009年04月27日 20:50 | |
Currently, Python switches from %f to %g formatting at 1e50. This applies both to the old-style percent formatting, and to the newer PEP 3101-style formatting: >>> '%f' % 2.**166 '93536104789177786765035829293842113257979682750464.000000' >>> '%f' % 2.**167 '1.87072e+50' >>> format(2.**166, 'f') '93536104789177786765035829293842113257979682750464.000000' >>> format(2.**167, 'f') '1.87072e+50' The main reason for the switch seems to have been implementation convenience: it makes it possible to use a fixed-size buffer in the float formatting routines. I propose removing this feature for Python 3.1, but leaving it in place for 2.7. See http://mail.python.org/pipermail/python-dev/2009-April/089030.html for additional discussion. |
|||
| msg86878 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2009年05月01日 10:37 | |
Here's a patch which doesn't fix the '%f' -> '%g' switch, but paves the way for that switch by getting rid of the fixed-size buffers in formatfloat in unicodeobject.c, and in the fallback version of PyOS_double_to_string. |
|||
| msg86881 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2009年05月01日 11:43 | |
No new test failures on Linux or OS X, with or without the fallback code. I've committed this in r72161. |
|||
| msg86882 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2009年05月01日 12:04 | |
The patch looks good to me. |
|||
| msg86884 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2009年05月01日 13:15 | |
Here's the patch that actually removes the %f -> %g switch. |
|||
| msg86886 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2009年05月01日 15:37 | |
Fixed in r72165. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:48 | admin | set | github: 50109 |
| 2009年05月01日 15:38:00 | mark.dickinson | set | status: open -> closed resolution: accepted messages: + msg86886 |
| 2009年05月01日 13:15:38 | mark.dickinson | set | files:
+ issue5859_stage2.patch messages: + msg86884 |
| 2009年05月01日 12:04:36 | eric.smith | set | messages: + msg86882 |
| 2009年05月01日 11:43:31 | mark.dickinson | set | messages: + msg86881 |
| 2009年05月01日 10:50:34 | mark.dickinson | set | stage: needs patch -> patch review |
| 2009年05月01日 10:37:45 | mark.dickinson | set | files:
+ issue5859_stage1.patch keywords: + patch messages: + msg86878 |
| 2009年04月27日 20:50:03 | mark.dickinson | create | |