Well, casting to long helped - but in how far does making
abs(unsigned - unsigned)
no sense? This does not sound very logical to me.
The result of (unsigned - unsigned) is unsigned.
What about A, B both unsigned and B > A?