]> granicus.if.org Git - python/commitdiff
Fix buggy comparison: LHS of comparison was being treated as unsigned.
authorMark Dickinson <dickinsm@gmail.com>
Wed, 13 Jan 2010 22:15:53 +0000 (22:15 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Wed, 13 Jan 2010 22:15:53 +0000 (22:15 +0000)
Python/dtoa.c

index 81221a5b351bb809ebae6e43f2f63bd45105d7d6..c8985bc980c55816cc66c0889446c8eb4dd0cb65 100644 (file)
@@ -1141,7 +1141,7 @@ sulp(U *x, BCinfo *bc)
 {
     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;