Arithmetic operator priority, bug?

Hello,
According to Powershell documentation at https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_arithmetic_operators?view=powershell-7.4, the operator -bor has higher priority than the operator -shl.
Which means that
8 -shl 2 -bor 1
should be evaluated as
8 -shl (2 -bor 1) , with a value of 64
But it is rather evaluated as
(8 -shl 2) -bor 1, with a value of 33
Clearly, the operator -shl here has higher priority than the operator -bor, which contradicts the documentation.
Is this a bug, or a documentation error? If the latter is true, can someone point me to a correct documentation page?
Thank you.

Same issue for
3 -bor 3 -band 2
Evaluated as (3 -bor 3) -band 2 = 2
Rather than 3 -bor (3 -band 2) = 3

They are of equal precedence according to the docs:

I think that’s why.

1 Like