Skip to content

bit shift operator precedence #13079

Closed
Closed
@JeffBezanson

Description

@JeffBezanson

Scrutinizing the operator precedence table, it struck me as a bit odd that bit shift operators have their own precedence level, strictly lower than multiplication. a*b>>c*d is an ugly expression to be sure, but it's parsed as (a*b)>>(c*d), which doesn't make a whole lot of sense.

Since a<<b means a*2^b, << should perhaps have the same precedence as *, or maybe even the same precedence as ^. Or maybe it should be moved to one notch higher than *, instead of one notch lower (putting it between * and //).

Metadata

Metadata

Assignees

Labels

breakingThis change will break codeneeds decisionA decision on this change is neededparserLanguage parsing and surface syntaxspeculativeWhether the change will be implemented is speculative

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions