[Python-checkins] r70679 - in python/branches/release26-maint: Doc/library/stdtypes.rst Objects/stringlib/formatter.h Objects/stringobject.c Objects/unicodeobject.c

mark.dickinson python-checkins at python.org
Sun Mar 29 17:06:29 CEST 2009


Author: mark.dickinson
Date: Sun Mar 29 17:06:29 2009
New Revision: 70679
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 (2009年3月29日) | 3 lines
 
 Issue #532631: Replace confusing fabs(x)/1e25 >= 1e25 test
 with fabs(x) >= 1e50, and fix documentation.
........
Modified:
 python/branches/release26-maint/ (props changed)
 python/branches/release26-maint/Doc/library/stdtypes.rst
 python/branches/release26-maint/Objects/stringlib/formatter.h
 python/branches/release26-maint/Objects/stringobject.c
 python/branches/release26-maint/Objects/unicodeobject.c
Modified: python/branches/release26-maint/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/stdtypes.rst	(original)
+++ python/branches/release26-maint/Doc/library/stdtypes.rst	Sun Mar 29 17:06:29 2009
@@ -1378,7 +1378,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/release26-maint/Objects/stringlib/formatter.h
==============================================================================
--- python/branches/release26-maint/Objects/stringlib/formatter.h	(original)
+++ python/branches/release26-maint/Objects/stringlib/formatter.h	Sun Mar 29 17:06:29 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/release26-maint/Objects/stringobject.c
==============================================================================
--- python/branches/release26-maint/Objects/stringobject.c	(original)
+++ python/branches/release26-maint/Objects/stringobject.c	Sun Mar 29 17:06:29 2009
@@ -4336,7 +4336,7 @@
 	}
 	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:
 
Modified: python/branches/release26-maint/Objects/unicodeobject.c
==============================================================================
--- python/branches/release26-maint/Objects/unicodeobject.c	(original)
+++ python/branches/release26-maint/Objects/unicodeobject.c	Sun Mar 29 17:06:29 2009
@@ -8228,7 +8228,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

AltStyle によって変換されたページ (->オリジナル) /