[Python-checkins] r71129 - python/branches/py3k-short-float-repr/Python/pystrtod.c

mark.dickinson python-checkins at python.org
Sat Apr 4 10:57:39 CEST 2009


Author: mark.dickinson
Date: Sat Apr  4 10:57:38 2009
New Revision: 71129

Log:
Fix off-by-one bug for 'g' formatting.


Modified:
   python/branches/py3k-short-float-repr/Python/pystrtod.c

Modified: python/branches/py3k-short-float-repr/Python/pystrtod.c
==============================================================================
--- python/branches/py3k-short-float-repr/Python/pystrtod.c	(original)
+++ python/branches/py3k-short-float-repr/Python/pystrtod.c	Sat Apr  4 10:57:38 2009
@@ -591,7 +591,7 @@
 	case 'e': use_exp = 1; break;
 	case 'f': use_exp = 0; break;
 	case 'g': {
-		if ((mode != 0) && (decpt > precision || decpt < -4))
+		if ((mode != 0) && (decpt > precision || decpt <= -4))
 			use_exp = 1;
 		else {
 			use_exp = 0;


More information about the Python-checkins mailing list