4 ms·
The problem is not just that it results in a wrong order for 8-bit encodings, but that it doesn’t result in a well-defined order at all. For example, you get:
by layer8 4y ago
The problem is not just that it results in a wrong order for 8-bit encodings, but that it doesn’t result in a well-defined order at all. For example, you get:
-2 > 127 > 64 > -2
This can make sorting algorithms loop infinitely or crash.
- koverstreet 4y agoBuggy comparison functions that don't correctly define an ordering is one of my favorite classes of bugs.
- layer8 4y agoIt’s also something that is difficult to unit-test.