Post Fix Notation Logic
[Rate this topic]

Mathematical and logical statements are typically expressed in infix notation, where the operator displays between the operands that it modifies.

For example, in the infix notation [ 2+3], [2] and [3] are operands, and [+] is the operator that acts on them.

 

In post-fix notation, the operator comes immediately after the operands that it modifies. The expression [ 2+3] is written [2 3 +].

 

Note: In post-fix notation, the operator acts only on one or two operands directly preceding it.  The operators always work from first to last instance, creating new values as they act on operands.

 

The following examples illustrate the two rules in action:

 

Infix Notation

Post-fix Notation

2+3= [2][+][3]

[2][3][+]

2+3-4=[2][+][3][-][4]=[5][-][4]

[2][3][+][4][-]=[5][4][-]
[2][3][4][-][+]=[2][-1][+]

2+3*4=[2][+][3][*][4]=[2][+][12]

[2][3][4][*][+]=[2][12][+]
[3][4][*][2][+]=[12][2][+]

2*3*4=[2][*][3][*][4]=[6][*][4] or [2][*][12]

[2][3][*][4][*]=[6][4][*]
[2][3][4][*][*]=[2][12][*]

 

 

 

 

Copyright © 2014 Medidata Solutions, Inc. All rights reserved.



How do you rate this topic?