]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 70680 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Sun, 29 Mar 2009 15:21:46 +0000 (15:21 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 29 Mar 2009 15:21:46 +0000 (15:21 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r70680 | mark.dickinson | 2009-03-29 16:19:47 +0100 (Sun, 29 Mar 2009) | 10 lines

  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.
  ........
................

Doc/library/stdtypes.rst
Objects/stringlib/formatter.h
Objects/unicodeobject.c

index 9a07c32b1a911ba020574635761aef1fb9da981e..3d3aa68dd8ff21fad71f261f8e5f6f8fd1689554 100644 (file)
@@ -1322,7 +1322,7 @@ that ``'\0'`` is the end of the string.
 .. 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::
index 2e3e5a675854f923f2d8fbaa983db15e16ee68b7..86235a64b508ab292bb741b3f855fde0ea3faef1 100644 (file)
@@ -789,7 +789,7 @@ format_float_internal(PyObject *value,
 
     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
index 7c26dce04f44258158bc4ea5e109f24a7fec277c..20b803e830430e58dee04460adb86b0303e53c16 100644 (file)
@@ -8584,7 +8584,7 @@ formatfloat(Py_UNICODE *buf,
         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: