Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: arithmetic operator precedence
- X-seq: zsh-workers 25173
- From: "Richard Hartmann" <richih.mailinglist@xxxxxxxxx>
- To: "Richard Hartmann" <richih.mailinglist@xxxxxxxxx>, "Peter Stephenson" <p.w.stephenson@xxxxxxxxxxxx>, "Zsh hackers list" <zsh-workers@xxxxxxxxxx>
- Subject: Re: arithmetic operator precedence
- Date: Tue, 17 Jun 2008 12:24:12 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=V0p0bpQ9ZoOTHS8mh3DVFXzAIKFUA2MkV5Qh1KPXXGY=; b=AeADoQEkcXmY1s5qdpD/jar6digX2zfST47YefYpv6XupReVIxRcoHk3wyC7NFzb/6 c7j9LmA9yu139KqKrcUyJMh+m3nFsN8lM2IFyesaOsFecXt+p+jpDwi5X8Zj7hv3YoHS 1/qqpzuOYZs4d4oGr4Mw8U1/CIyfgmulPxwzo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=yGxRNgW9a6DhljR/UoANdUWJodezSqTTq7UBIHH4+BMvZ3qHklSvzNzIlt7dBWgnY5 HBh4H22Dm8V96fX3Emab8Bei4/85IW5R2Pm4yYLx73n/yrG+VV5OeFt/ZkzF1qDR7xhJ 6V4xRIBbhhfXtkQZBgk1NZAwhzy212jVztpjk=
- In-reply-to: <20080617094509.GC5016@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080612095723.GF5113@xxxxxxxxxxxxxxx> <20080616080726.GP10734@xxxxxxxxxxxxxxxxxxx> <20080616144211.276fb0e3@pws-pc> <2d460de70806170219k12ff4cadn441b52c48bf8076f@xxxxxxxxxxxxxx> <20080617094509.GC5016@xxxxxxxxxxxxxxx>
On Tue, Jun 17, 2008 at 11:45, Stephane Chazelas
<Stephane_Chazelas@xxxxxxxx> wrote:
> In which way is it more "mathematically" correct?
>
> Is that because -3² is -9?
>
> But ** is not ^, it's a binary operator whose shape reminds that
> of multiply, like a multiply++. And even then, POSIX's ^ in bc
> is handled as -3^2 = 9.
As far as I know, ^ and ** are fuly equivalent. If that is not the case, then
sorry. Do you have a link/manpage/whatever on this topic?
> It could be a good idea to ask ksh, POSIX/bc and perl authors for
> the rationale behind their choices.
Richard
Messages sorted by:
Reverse Date,
Date,
Thread,
Author