म
MarathiCodeby Sprout Tech
Documentation topicsOperator Precedence
MarathiCode v0.2.0

Operator Precedence

ऑपरेटर क्रम

Operators higher in the table bind more tightly. Parentheses always override the order.

LevelOperatorsNotes
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 (आउटपुट)
खरे
खोटे