[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: Type bug with "08" and "09"
From:       Steve Hall <digitect () mindspring ! com>
Date:       2004-03-26 15:45:03
Message-ID: 21988565.1080315905278.JavaMail.root () wamui10 ! slb ! atl ! earthlink ! net
[Download RAW message or body]


["echo 07" produces "7" while "echo 08" produces "0 8"]

From: Gary Holloway, Mar 25, 2004 6:17 PM
> owen beresford wrote:
> > On Thu, 25 Mar 2004 14:25:01 -0800, "Gary Holloway" said:
> > >
> > > Looks like it's caused by leading '0's causing the numbers to
> > > interpreted as octal, ....
> > > 
> > > (Try "echo 011 + 3"; you'll get 12, which is 9 + 3)
> > 
> > if its being consistent, surely the output should be in octal as
> > well. hence: 011 + 3 = 014
>
> Well, not really, 011 is octal, 3 is not; which should be used when
> bases are mixed? ....vim (currently) always converts to and outputs
> in decimal, which is consistent with most programming languages;

Yes, the inconsistancy is what I think is a bug. I suppose one has to
write a NotOctal(string) function to obtain a string verified not to
be misinterpreted.

-- 
Steve Hall  [ digitect@mindspring.com ]



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic