[Python-checkins] r77482 - python/trunk/Python/dtoa.c

mark.dickinson python-checkins at python.org
Wed Jan 13 23:15:53 CET 2010


Author: mark.dickinson
Date: Wed Jan 13 23:15:53 2010
New Revision: 77482

Log:
Fix buggy comparison:  LHS of comparison was being treated as unsigned.

Modified:
   python/trunk/Python/dtoa.c

Modified: python/trunk/Python/dtoa.c
==============================================================================
--- python/trunk/Python/dtoa.c	(original)
+++ python/trunk/Python/dtoa.c	Wed Jan 13 23:15:53 2010
@@ -1141,7 +1141,7 @@
 {
     U u;
 
-    if (bc->scale && 2*P + 1 - ((word0(x) & Exp_mask) >> Exp_shift) > 0) {
+    if (bc->scale && 2*P + 1 > (int)((word0(x) & Exp_mask) >> Exp_shift)) {
         /* rv/2^bc->scale is subnormal */
         word0(&u) = (P+2)*Exp_msk1;
         word1(&u) = 0;


More information about the Python-checkins mailing list