From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1364 invoked by alias); 2 Dec 2012 22:15:22 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17446 Received: (qmail 8090 invoked from network); 2 Dec 2012 22:15:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at smasher.org designates 69.55.237.145 as permitted sender) X-POM: The Moon is Waning Gibbous (84% of Full) Date: Mon, 3 Dec 2012 11:15:04 +1300 (NZDT) From: Atom Smasher To: zsh-users@zsh.org Subject: Re: $[ 09.5 ] -- bad math expression In-Reply-To: <121202135940.ZM19771@torch.brasslantern.com> Message-ID: References: <121202135940.ZM19771@torch.brasslantern.com> OpenPGP: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Sun, 2 Dec 2012, Bart Schaefer wrote: > On Dec 2, 11:30pm, Atom Smasher wrote: > } > } echo "$[ 09.5 ]" > } zsh: bad math expression: operator expected at `.5 ' > } > } the problem seems to come up when using a non-integer with a leading > } zero. > > Hmm. This appears to have changed back in about 2007, workers/23165. > Any number with a leading zero is interpreted as an integer, unless a > decimal point immediately follows the zero, in which case it's treated > as floating point. =============== thanks! i'll give a try with the workaround, and look forward to the patch being incorporated into new builds! i guess i can also strip the leading zero(s) from any numbers where that could be an issue... -- ...atom ________________________ http://atom.smasher.org/ 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 ------------------------------------------------- "We in the West must bear in mind that the poor countries are poor primarily because we have exploited them through political or economic colonialism." -- Martin Luther King, Jr