Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: arithmetic operator precedence
- X-seq: zsh-workers 25223
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: arithmetic operator precedence
- Date: Thu, 19 Jun 2008 19:25:58 +0200
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>
- In-reply-to: <20080619162718.GG5016@xxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx, Mikael Magnusson <mikachu@xxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080617103829.GD5016@xxxxxxxxxxxxxxx> <20080617114340.398c731f@news01> <20080617112815.GF10734@xxxxxxxxxxxxxxxxxxx> <200806171146.m5HBkhfR013230@xxxxxxxxxxxxxx> <a0600102dc47fd2c6184e@xxxxxxxxxxxxxxxxx> <200806190958.m5J9w7BJ006695@xxxxxxxxxxxxxx> <2d460de70806190529p1255b8b5mfe2fb2c1e1d7ba35@xxxxxxxxxxxxxx> <20080619160433.GL10734@xxxxxxxxxxxxxxxxxxx> <237967ef0806190910q70c0d0d7y2466938b547a8ee4@xxxxxxxxxxxxxx> <20080619162718.GG5016@xxxxxxxxxxxxxxx>
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 <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author