Hacker News new | ask | show | jobs
by 1SaltwaterC 4842 days ago
If you look at my comparison, you can see that it isn't a decimal number. I said (dropping the v prefix, that may bee to subtle for HN): 0.8 < 0.10 < 0.80. In decimal that would be: 0.8 < 0.1 < 0.8 - the comparison doesn't work this way (duh). But it isn't lexicographic sorting either. This sequence: 0.8, 0.80, 0.2, 0.20 has this lexicographic order: 0.2, 0.20, 0.8, 0.80, while a proper version ordering is to compare the stuff after the dot aka 2 < 8 < 20 < 80.