Look into Integer.compare(a, b). It is something like this:
Integer.compare(a, b)
int sign = (a < b ? 1 : (a > b ? -1 : 0));
and choose a = 0 and b = col.
a = 0
b = col