[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: operator precedence confusion
From: |
Mike McClain |
Subject: |
Re: operator precedence confusion |
Date: |
Mon, 29 Apr 2024 17:04:19 -0500 |
On Mon, Apr 29, 2024 at 03:51:11PM -0400, Lawrence Vel??zquez wrote:
> On Mon, Apr 29, 2024, at 3:43 PM, Mike McClain wrote:
> > $ help let says:
> > The following list of operators is grouped into levels of
> > equal-precedence operators.
> > The levels are listed in order of decreasing precedence.
> >
> > id++, id-- variable post-increment, post-decrement
> > ++id, --id variable pre-increment, pre-decrement
> > -, + unary minus, plus
> > !, ~ logical and bitwise negation
> > ** exponentiation
> > *, /, % multiplication, division, remainder
> > .
> > .
> > .
> >
> > Hence plus(+) has higher precedence than multiplication(*).
>
> *Unary* plus has higher precedence -- i.e., the positive sign.
> You cut off the help text right at the relevant part:
>
> *, /, % multiplication, division, remainder
> +, - addition, subtraction
>
> --
> vq
You are absolutely correct sir.
Again I've got egg on my face, not an uncommon occurance.
I saw what I expected to see.
Thanks,
Mike
--
"Change is not necessary if survival is not mandatory."
- 'American Bee Journal' Nov. 2019