*To*: "Roberto C. Sanchez" <roberto@familiasanchez.net>*Cc*: debian-devel@lists.debian.org*Subject*: Re: dpkg doing wrong math (0.09 = 0.9) ?-*From*: Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de>*Date*: Sat, 12 Aug 2006 00:20:39 +0200*Message-id*: <873bc2kj7s.fsf@informatik.uni-tuebingen.de>*In-reply-to*: <20060810234736.GG17235@miami.connexer.com>*References*: <20060808235835.GA19278@lapse.madduck.net> <87mzae1a7d.fsf@mid.deneb.enyo.de> <44DBBD7B.8020909@teco.edu> <20060810232940.GA6592@chistera.yi.org> <20060810234736.GG17235@miami.connexer.com>

"Roberto C. Sanchez" <roberto@familiasanchez.net> writes: > On Fri, Aug 11, 2006 at 01:29:40AM +0200, Adeodato Simó wrote: >> * Michael Biebl [Fri, 11 Aug 2006 01:12:59 +0200]: >> >> > that "dpkg --compare-versions '0.09' '=' '0.9'" yields true, which I >> > think is rather odd, because it means that now all version numbers up to >> > 0.9 will be considered < 0.09+0.1. >> >> 0.09 = 0.9 means: >> >> 0 == 0 >> and >> . == . >> and >> 09 == 9 >> >> Which is pretty standard math. ;-) >> > Except that the final comparison ignores that the number was to the > right of the decimal, making the zero significant. I think you will be > hard pressed to find a mathematician who supports dropping significant > zeros for no good reason. > > -Roberto Well, lets go math (well, not totaly formal :): Debian version 0.09 == 0:0.09 == {(0, "", 0), (1, "", 0), (2, ".", 09)} Debian version 0.1 == 0:0.1 == {(0, "", 0), (1, "", 0), (2, ".", 1)} Where two triplets of (id, s, n) are comparable for id1 == id2 and then s1 is compared to s2 first and only then n1 to n2. Sets of those tripplets are compared by order of id comparing triplets with matching ids and the first non-matching triplet decides the order. This confirms that 0.09 >> 0.1. MfG Goswin PS: ~ was ignored for simplicity.

**References**:**Re: dak now supports ~ in version numbers***From:*Florian Weimer <fw@deneb.enyo.de>

**dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]***From:*Michael Biebl <biebl@teco.edu>

**Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]***From:*Adeodato Simó <dato@net.com.org.es>

**Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]***From:*"Roberto C. Sanchez" <roberto@familiasanchez.net>

- Prev by Date:
**Re: Silly Packaging Problem** - Next by Date:
**Re: cdrtools** - Previous by thread:
**Re: dpkg doing wrong math (0.09 = 0.9) ?-** - Next by thread:
**Re: dpkg doing wrong math (0.09 = 0.9) ?-** - Index(es):