To sort numbers (or anything for that matter) you have to compare them first to know where they fit...
As you do not want to use the basic compare-operators (<, >, =) you have to learn bit-wise operations...
Let see a sample
int x, y;
bool xGTy = (((x + y) ^ (x - y)) < 0);
xGTy
(x-grater-than-y) is true if
(x + y)
and
(x - y)
has different signs, which means x greater than y (assuming positive integers)...
The same - very complicated - way you can built functions that can compare numbers using only bit-wise operations...
There is an interesting paper about it:
Bit Twiddling Hacks[
^]