*To*: debian-devel@lists.debian.org, "Roberto C. Sanchez" <roberto@familiasanchez.net>*Subject*: Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]*From*: Lionel Elie Mamane <lionel@mamane.lu>*Date*: Mon, 21 Aug 2006 18:51:24 +0200*Message-id*: <20060821165124.GA9375@capsaicin.mamane.lu>*Mail-followup-to*: debian-devel@lists.debian.org, "Roberto C. Sanchez" <roberto@familiasanchez.net>*In-reply-to*: <20060811004253.GD26527@hezmatt.org>*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> <20060811004253.GD26527@hezmatt.org>

On Fri, Aug 11, 2006 at 10:42:53AM +1000, Matthew Palmer wrote: > On Thu, Aug 10, 2006 at 07:47:36PM -0400, Roberto C. Sanchez wrote: >> 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, >>> 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. > I'd imagine you'd be hard pressed to find a mathematician who knows > what to do with a number that reads 0.0.9, either. Well, I have found one. Myself. You just have to interpret the part after the second point as the integer part of an infinitesimal: Let ε be an infinitesimal, that is a strictly positive number (that is ε > 0) smaller than any strictly positive real number (that is ∀ n ∈ ℕ, n>0 implies ε < 1/n ). Then the version number x.y.z is interpreted as: x.y + z * ε (And a.b.c.d is interpreted as a.b + c.d * ε) Before anyone asks, yes I can go on for as many dots as you want. I just introduce a η that is strictly positive, yet strictly smaller than any ε/n for n ∈ ℕ, and I have up to five dots (six components). There are probably several ways to construct suitable ε and η and beyond, but presenting one of them is off-topic; I can present at least one of them to interested persons (Conway surreal numbers). Actually, in the Conway surreal numbers formalism, ε² would be a suitable η, but one can do better (a η that is smaller than any power of ε, yet strictly positive). One can also take the problem the other way round and use very big numbers instead of very small ones (for example the א hierarchy); the order is much less natural then, though. -- Lionel

**Follow-Ups**:**Re: dpkg doing wrong math (0.09 = 0.9) ?-***From:*Florian Weimer <fw@deneb.enyo.de>

**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>

**Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]***From:*Matthew Palmer <mpalmer@debian.org>

- Prev by Date:
**Re: Please comment the license of vim manual and reference** - Next by Date:
**Re: Please comment the license of vim manual and reference** - Previous by thread:
**Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]** - Next by thread:
**Re: dpkg doing wrong math (0.09 = 0.9) ?-** - Index(es):