[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: operator precedence confusion
From: |
Lawrence Velázquez |
Subject: |
Re: operator precedence confusion |
Date: |
Mon, 29 Apr 2024 15:51:11 -0400 |
User-agent: |
Cyrus-JMAP/3.11.0-alpha0-386-g4cb8e397f9-fm-20240415.001-g4cb8e397 |
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