Quote:Original post by ToohrVykIt looks very much to me like your OP is reversing the comparison. If 5 > 3 you want F(3) > F(5).
The post is correct, I do want to reverse the comparison.
I would simply add the offset required to make the most negative value equal to zero (which would be 0x80000000), then cast it to an unsigned.
In fact, that's exactly what I did in my signed bigint class. For a signed comparison it does just that, then calls the unsigned comparison functions.
I'm impressed that Nemesis2k2 also describes the reversal, which I hdan't thought of, and as others have mentioned, the add can be replaced with an xor.