top | item 47090393

(no title)

jedisct1 | 9 days ago

a_int and b_int are signed values.

discuss

order

rep_lodsb|9 days ago

It makes no difference whether they're signed or unsigned. Unless the subtraction is checking for overflow, or using a wider integer type than the numbers being compared, the high bit will not in every case indicate which number is smaller.

e.g.

    0x8000_0000 < 0x0000_0001 for signed numbers
    0x8000_0000 - 0x0000_0001 = 0x7fff_ffff, high bit clear

jedisct1|9 days ago

They are using a wider type.