]> granicus.if.org Git - python/commitdiff
Changed hex() and oct() again, to never emit a '-' sign.
authorGuido van Rossum <guido@python.org>
Sun, 12 Jan 1997 19:48:03 +0000 (19:48 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 12 Jan 1997 19:48:03 +0000 (19:48 +0000)
Objects/intobject.c

index c4ade847fdceb4ef4adcf5d59d1f237d910790e7..76d914584dac1b64eaf7d4bffe5e84a1f7bd95cb 100644 (file)
@@ -725,10 +725,8 @@ int_oct(v)
        long x = v -> ob_ival;
        if (x == 0)
                strcpy(buf, "0");
-       else if (-x < 0)
-               sprintf(buf, "0%lo", x);
        else
-               sprintf(buf, "-0%lo", -x);
+               sprintf(buf, "0%lo", x);
        return newstringobject(buf);
 }
 
@@ -738,10 +736,7 @@ int_hex(v)
 {
        char buf[20];
        long x = v -> ob_ival;
-       if (-x <= 0)
-               sprintf(buf, "0x%lx", x);
-       else
-               sprintf(buf, "-0x%lx", -x);
+       sprintf(buf, "0x%lx", x);
        return newstringobject(buf);
 }