Jump to content

Infix notation

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by All is love love (talk | contribs) at 13:31, 30 August 2014 ((edited with ProveIt)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Infix notation is the common arithmetic and logical formula notation, in which operators are written infix-style between the operands they act on (e.g. 2 + 2). Infix notation is more difficult to parse by computers than prefix notation ( e.g. + 2 2 ) or postfix notation ( e.g. 2 2 + ). However many programming languages use it due to its familiarity. It is more used in arithmetic, e.g. 2+2, 5×6.[1]

In infix notation, unlike in prefix or postfix notations, parentheses surrounding groups of operands and operators are necessary to indicate the intended order in which operations are to be performed. In the absence of parentheses, certain precedence rules determine the order of operations.

Infix notation may also be distinguished from function notation, where the name of a function suggests a particular operation, and its arguments are the operands. An example of such a function notation would be S(1,3) in which the function S denotes addition: S(1,3) = 1+3 = 4.

See also

  1. ^ "The Implementation and Power of Programming Languages". Retrieved 30 August 2014.