[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]



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, 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.

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.  That's why we're software
developers, not mathematicians.

Or, to put it another way: your numbers are not our numbers.  <grin>

- Matt



Reply to: