• Robert Bradshaw's avatar
    Return a signed value for abs(int). · f05f6164
    Robert Bradshaw authored
    This means abs(MIN_INT) has the "overflow" behavior of returning
    MIN_INT as in C, but avoids surprising unsigned arithmetic for all
    other values.
    
    To preserve Python compatibility, abs(x) dissallows integer inference
    for x just like the other potentially overflowing arithmetic operators.
    
    This fixes Github Issue #1837
    f05f6164
Builtins.c 15.4 KB