From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1087 invoked from network); 28 Nov 1997 20:40:03 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 28 Nov 1997 20:40:03 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id PAA18791; Fri, 28 Nov 1997 15:33:41 -0500 (EST) Resent-Date: Fri, 28 Nov 1997 15:33:18 -0500 (EST) Message-ID: <19971128153022.58317@retriever> Date: Fri, 28 Nov 1997 15:30:22 -0500 From: Louis-David Mitterrand To: zsh-users@math.gatech.edu Subject: Re: strange arithmetic Reply-To: mito@aparima.com References: <19971128140924.07137@retriever> <347F26A5.BBB84546@sangacorp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88 In-Reply-To: <347F26A5.BBB84546@sangacorp.com>; from Alain Caron on Fri, Nov 28, 1997 at 03:16:37PM -0500 Resent-Message-ID: <"Xc2gz2.0.-a4.DgoVq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1162 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Fri, Nov 28, 1997 at 03:16:37PM -0500, Alain Caron wrote: > > % 90 > > > > 90 ?? I asked for 900 and it stops at 90. On the other hand the > > following: > > > > % i=0;while ! [[ $[++i] = 900 ]];do;echo $i;done > > % 1 > > % 2 > > [...] > > % 899 > > > > Is this normal? > > This is, I presume, because ">" and "=" are doing a lexicographic > comparison. For a numeric > comparison, use "-gt" and "-eq" operators. Thanks to you and zefram, I guess I've been exposed to Perl for a little too long (the time I could put off learning shell scripting ;-). And to think I thought I had discovered a bug in mighty zsh .. -- Louis-David Mitterrand http://www.aparima.com mito@aparima.com