Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my mind, these are not decimal numbers, these are version, subversion(, revision), so 1.10 comes after 1.9

EDIT: I'm also reminded of after minecraft 1.9 came out, everyone going "does that mean that minecraft 2.0 is next?" like no, its 1.10 next



I see where you are coming from.

I would check what GNU's vercmp and Arch's vercmp would say, but I have no access to them right now.


Only got access to the Arch version.

    $ vercmp 1.9 1.10
    -1
    $ vercmp --help
    vercmp (pacman) v7.0.0
    
    Compare package version numbers using pacman's version comparison logic.
    
    Usage: vercmp <ver1> <ver2>
    
    Output values:
      < 0 : if ver1 < ver2
        0 : if ver1 == ver2
      > 0 : if ver1 > ver2


Same for me (vercmp v6.0.2, Ubuntu 24.04.2)


sort -V works the same way (1.10 > 1.9 > 1.1), as does every package manager I've ever used. Using floats for version numbers is just as insane as using them for financial transactions, but that's classic Perl for you (bonkers in their own unique way, with an optional sane system that exists in parallel which then lets you create even more bugs by confusing them).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: