I have two byte-arrays (in Java) representing two (possibly negative) numbers.
How do I compare them (ie., finding out which one is smaller/greater)?
Currently, I just compare them by resurrecting them into two java's int
and then doing the comparison. But that'd give the wrong result in cases where one of the byte-array represents a negative number and the other positive.It's impossible to tell whether the left-most bit is the sign or just part of the number, right?
Thanks