in reply to Re: Compare two signed integers without using comparision operator in perl
in thread Compare two signed integers without using comparision operator in perl
This doesn't work if at least one of the numbers is negative.
I don't think it matters for this particular case, as string comparison is comparison nevertheless, but still... It's the only reason I can think of why the sign would matter.
p.s. It's even an excellent way to compare groups of strings/numbers in one comparison, for example, for sort.
|
|---|