Software Versioning - Version Number Ordering Systems

Version Number Ordering Systems

Version numbers very quickly evolve from simple integers (1, 2, ...) to rational numbers (2.08, 2.09, 2.10) and then to non-numeric "numbers" such as 4:3.4.3-2. These complex version numbers are therefore better treated as character strings. Operating systems that include package management facilities (such as all non-trivial Linux or BSD distributions) will use a distribution-specific algorithm for comparing version numbers of different software packages. For example, the ordering algorithms of Red Hat and derived distributions differ to those of the Debian-like distributions.

As an example of surprising version number ordering implementation behavior, in Debian, leading zeroes are ignored in chunks, so that 5.0005 and 5.5 are considered as equal, and 5.5<5.0006. This can confuse users; string-matching tools may fail to find a given version number; and this can cause subtle bugs in package management if the programmers use string-indexed data structures such as version-number indexed hash tables.

In order to ease sorting, some software packages will represent each component of the major.minor.release scheme with a fixed width. Perl represents its version numbers as a floating-point number, for example, Perl's 5.8.7 release can also be represented as 5.008007. This allows a theoretical version of 5.8.10 to be represented as 5.008010. Other software packages will pack each segment into a fixed bit width, for example, 5.8.7 could be represented in 24 bits: ( 5 << 16 | 8 << 8 | 7; hexadecimal: 050807; for version 12.34.56 in hexadecimal: 0C2238). The floating-point scheme will break down if any segment of the version number exceeds 1,000; a packed-binary scheme employing 8 bits apiece after 256.

Read more about this topic:  Software Versioning

Famous quotes containing the words version, number, ordering and/or systems:

    Truth cannot be defined or tested by agreement with ‘the world’; for not only do truths differ for different worlds but the nature of agreement between a world apart from it is notoriously nebulous. Rather—speaking loosely and without trying to answer either Pilate’s question or Tarski’s—a version is to be taken to be true when it offends no unyielding beliefs and none of its own precepts.
    Nelson Goodman (b. 1906)

    How often should a woman be pregnant? Continually, or hardly ever? Or must there be a certain number of pregnancy anniversaries established by fashion? What do you, at the age of forty-three, have to say on the subject? Is it a fact that the laws of nature, or of the country, or of propriety, have ordained this time of life for sterility?
    Philip Dormer Stanhope, 4th Earl Chesterfield (1694–1773)

    Make gracious attempts at sanctifying Jenny,
    Supply cosmetics for the ordering of her frame,
    Think of her as Leda, as a goddess,
    Emptying a smile on Redkey, Indiana.
    Allen Tate (1899–1979)

    What avails it that you are a Christian, if you are not purer than the heathen, if you deny yourself no more, if you are not more religious? I know of many systems of religion esteemed heathenish whose precepts fill the reader with shame, and provoke him to new endeavors, though it be to the performance of rites merely.
    Henry David Thoreau (1817–1862)