Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: arithmetic operator precedence



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