Parsing/RPN to infix conversion: Difference between revisions
Content added Content deleted
m (added a fourth column to the operator precedence table, added highlighting to better read the operator symbols, elided the necessity of a "Note".) |
|||
Line 17: | Line 17: | ||
|} |
|} |
||
* Operator precedence is given in this table: |
* Operator precedence and operator associativity is given in this table: |
||
:{| class="wikitable" |
:{| class="wikitable" |
||
! operator !! [[wp:Order_of_operations|precedence]] !! [[wp:Operator_associativity|associativity]] |
! operator !! [[wp:Order_of_operations|precedence]] !! [[wp:Operator_associativity|associativity]] !! operation |
||
|- || align="center" |
|- || align="center" |
||
| <big><big> ^ </big></big> || 4 || right || exponentiation |
|||
| ^ || 4 || Right |
|||
|- || align="center" |
|- || align="center" |
||
| <big><big> * </big></big> || 3 || left || multiplication |
|||
| * || 3 || Left |
|||
|- || align="center" |
|- || align="center" |
||
| <big><big> / </big></big> || 3 || left || division |
|||
| / || 3 || Left |
|||
|- || align="center" |
|- || align="center" |
||
| <big><big> + </big></big> || 2 || left || addition |
|||
| + || 2 || Left |
|||
|- || align="center" |
|- || align="center" |
||
| <big><big> - </big></big> || 2 || left || subtraction |
|||
| - || 2 || Left |
|||
|} |
|} |
||
;Note: |
|||
* The (above) symbol <big><big>''' ^ ''' </big></big> indicates exponentiation. |
|||