Documentation topicsOperator Precedence
Lexical Structure
Control Flow
Functions & Scope
Lists & Built-ins
Reference
MarathiCode v0.2.0
Operator Precedence
ऑपरेटर क्रम
Operators higher in the table bind more tightly. Parentheses always override the order.
| Level | Operators | Notes |
|---|---|---|
| 1 (highest) | x[i], f(...), ( ) | Indexing, calls, grouping |
| 2 | नाही, - (unary) | Right to left |
| 3 | * / % | Left to right |
| 4 | + - | Left to right |
| 5 | > < >= <= | Left to right |
| 6 | == != | Left to right |
| 7 | आणि | Short-circuit |
| 8 (lowest) | किंवा | Short-circuit |
precedence.mr
छापा(2 + 3 * 4)
छापा((2 + 3) * 4)
छापा(10 - 4 - 3)
छापा(खरे किंवा खोटे आणि खोटे)
छापा(-2 * 3)Output (आउटपुट)
14 20 3 खरे -6
नाही binds more tightly than comparisons, so नाही x == 5 means (नाही x) == 5. To negate a comparison, use parentheses: नाही (x == 5).not_precedence.mr
चल x = 3
छापा(नाही (x == 5))
छापा(नाही x == 5)Output (आउटपुट)
खरे खोटे