From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15236 invoked from network); 19 Jun 2008 17:26:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Jun 2008 17:26:23 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 38534 invoked from network); 19 Jun 2008 17:26:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Jun 2008 17:26:20 -0000 Received: (qmail 10300 invoked by alias); 19 Jun 2008 17:26:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25223 Received: (qmail 10284 invoked from network); 19 Jun 2008 17:26:17 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 19 Jun 2008 17:26:17 -0000 Received: from prunille.vinc17.org (vinc17.pck.nerim.net [213.41.242.187]) by bifrost.dotsrc.org (Postfix) with ESMTP id C19838084FA0 for ; Thu, 19 Jun 2008 19:25:58 +0200 (CEST) Received: by prunille.vinc17.org (Postfix, from userid 501) id 810A42368EBD; Thu, 19 Jun 2008 19:25:58 +0200 (CEST) Date: Thu, 19 Jun 2008 19:25:58 +0200 From: Vincent Lefevre To: zsh-workers@sunsite.dk Cc: Mikael Magnusson Subject: Re: arithmetic operator precedence Message-ID: <20080619172558.GO10734@prunille.vinc17.org> Mail-Followup-To: zsh-workers@sunsite.dk, Mikael Magnusson References: <20080617103829.GD5016@sc.homeunix.net> <20080617114340.398c731f@news01> <20080617112815.GF10734@prunille.vinc17.org> <200806171146.m5HBkhfR013230@news01.csr.com> <200806190958.m5J9w7BJ006695@news01.csr.com> <2d460de70806190529p1255b8b5mfe2fb2c1e1d7ba35@mail.gmail.com> <20080619160433.GL10734@prunille.vinc17.org> <237967ef0806190910q70c0d0d7y2466938b547a8ee4@mail.gmail.com> <20080619162718.GG5016@sc.homeunix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080619162718.GG5016@sc.homeunix.net> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.18-vl-r22984 (2008-06-11) X-Virus-Scanned: ClamAV 0.92.1/7506/Thu Jun 19 16:51:14 2008 on bifrost X-Virus-Status: Clean On 2008-06-19 17:27:18 +0100, Stephane Chazelas wrote: > Think of: > > double() { > REPLY=$(($1 * 2)) > } > > square() { > REPLY=$(($1 ** 2)) > } Why are you so stubborn? double() { REPLY=$((($1) * 2)) } is the correct way to do and works with 'double 1+1' and so on. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)