[Python-checkins] r70680 - in python/branches/py3k: Doc/library/stdtypes.rst Objects/stringlib/formatter.h Objects/unicodeobject.c
mark.dickinson
python-checkins at python.org
Sun Mar 29 17:19:47 CEST 2009
Author: mark.dickinson
Date: Sun Mar 29 17:19:47 2009
New Revision: 70680
Log:
Merged revisions 70678 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r70678 | mark.dickinson | 2009-03-29 15:37:51 +0100 (Sun, 29 Mar 2009) | 3 lines
Issue #532631: Replace confusing fabs(x)/1e25 >= 1e25 test
with fabs(x) >= 1e50, and fix documentation.
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Doc/library/stdtypes.rst
python/branches/py3k/Objects/stringlib/formatter.h
python/branches/py3k/Objects/unicodeobject.c
Modified: python/branches/py3k/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/stdtypes.rst (original)
+++ python/branches/py3k/Doc/library/stdtypes.rst Sun Mar 29 17:19:47 2009
@@ -1322,7 +1322,7 @@
.. XXX Examples?
For safety reasons, floating point precisions are clipped to 50; ``%f``
-conversions for numbers whose absolute value is over 1e25 are replaced by ``%g``
+conversions for numbers whose absolute value is over 1e50 are replaced by ``%g``
conversions. [#]_ All other errors raise exceptions.
.. index::
Modified: python/branches/py3k/Objects/stringlib/formatter.h
==============================================================================
--- python/branches/py3k/Objects/stringlib/formatter.h (original)
+++ python/branches/py3k/Objects/stringlib/formatter.h Sun Mar 29 17:19:47 2009
@@ -789,7 +789,7 @@
if (precision < 0)
precision = 6;
- if (type == 'f' && (fabs(x) / 1e25) >= 1e25)
+ if (type == 'f' && fabs(x) >= 1e50)
type = 'g';
/* cast "type", because if we're in unicode we need to pass a
Modified: python/branches/py3k/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k/Objects/unicodeobject.c (original)
+++ python/branches/py3k/Objects/unicodeobject.c Sun Mar 29 17:19:47 2009
@@ -8847,7 +8847,7 @@
return -1;
if (prec < 0)
prec = 6;
- if (type == 'f' && (fabs(x) / 1e25) >= 1e25)
+ if (type == 'f' && fabs(x) >= 1e50)
type = 'g';
/* Worst case length calc to ensure no buffer overrun:
More information about the Python-checkins
mailing list