Re:Nearly All Binary Searches and Mergesorts Are Broken (2006)
by pclmulqdq on Sunday November 06, 2022 @10:58AM
(#33493939)
I didn't say that a signed int would be fine. I said that a signed 64-bit int would be fine.
Moreover, it is trivial to convert from a 32-bit signed or unsigned type to a 64-bit int, so you are not constrained by the size type of Java.
Moreover I don't see how you deny that using signed would lose functionality in this case—it's pretty undeniable that it gives the wrong answer in cases where unsigned would give the correct answer; the code is right in the article and you can test it out. This is true irrespective of any other cases that neither might handle correctly (assuming you believe any exist, but see my previous paragraph).