4 ms·
Version 0.8 isn't version 0.80. A version number is a sequence of natural numbers, ordered lexicographically and written with periods separating elements. The v
by homeomorphic 14y ago
Version 0.8 isn't version 0.80. A version number is a sequence of natural numbers, ordered lexicographically and written with periods separating elements. The version (x1, x2, ...) compares to the version (y1, y2, ...) as follows: If x1 =/= y1, then whichever of x1 and y1 is bigger decides which version is the highest. Otherwise, recurse and compare the versions (x2, x3, ...) and (y2, y3, ...).
You can think of a decimal number in the same way (well, leaving out some minor technicalities with numbers requiring infinite expansions here), but you then have to allow only numbers between 0 and 9 (inclusive) in your sequence. Let's leave out positive numbers (because otherwise we'd have to grow sequences in both directions from the decimal point, which is an annoying technicality). Then 0.12345 is simply the sequence (1, 2, 3, 4, 5), which in version notation is 0.1.2.3.4.5. On the other hand, decimal 0.80 is version 0.8.0, not version 0.80.
Really, all in all, version numbers are just decimal expansions, except that we leave out the equivalence relation that says that, for example, 10x10^1 is the same as 1x10^2. So while 0.8.0 and 0.80.0 are distinct version numbers, they collapse to the same value as real numbers (or you might want to collapse 0.80.0 to 8.0 -- it doesn't matter, that's all a matter of taste).