Skip to content

Operator Precedence

Programming

Learn operator precedence and associativity to predict evaluation order.

Official Site
01

Overview

Precedence determines evaluation order. ** is right-associative; most others left. Use parentheses for clarity.

bash
2**3**2 // 512  8/2/2 // 2
2+3*4 // 14 (* > +)
02

Best Practices

Use parentheses even when correct. Never chain ternaries without parens. && binds tighter than ||.

Ready to try Operator Precedence?

Visit the official site for the latest version and full documentation.

Visit Operator Precedence