Infix notation is the notation commonly used in
arithmetic
Arithmetic () is an elementary part of mathematics that consists of the study of the properties of the traditional operations on numbers— addition, subtraction, multiplication, division, exponentiation, and extraction of roots. In the 19th ...
al and
logical formulae and statements. It is characterized by the placement of
operator
Operator may refer to:
Mathematics
* A symbol indicating a mathematical operation
* Logical operator or logical connective in mathematical logic
* Operator (mathematics), mapping that acts on elements of a space to produce elements of another ...
s between
operands—"
infix
An infix is an affix inserted inside a word stem (an existing word or the core of a family of words). It contrasts with ''adfix,'' a rare term for an affix attached to the outside of a stem, such as a prefix or suffix.
When marking text for int ...
ed operators"—such as the
plus sign
The plus and minus signs, and , are mathematical symbols used to represent the notions of positive and negative, respectively. In addition, represents the operation of addition, which results in a sum, while represents subtraction, result ...
in .
Usage
Binary relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over Set (mathematics), sets and is a new set of ordered pairs consisting of ele ...
s are often denoted by an infix symbol such as
set membership
In mathematics, an element (or member) of a set is any one of the distinct objects that belong to that set.
Sets
Writing A = \ means that the elements of the set are the numbers 1, 2, 3 and 4. Sets of elements of , for example \, are subsets o ...
''a'' ∈ ''A'' when the set ''A'' has ''a'' for an element. In
geometry,
perpendicular lines
In elementary geometry, two geometric objects are perpendicular if they intersection, intersect at a right angle (90 degrees or π/2 radians). The condition of perpendicularity may be represented graphically using the ''perpendicular symbol'', ...
''a'' and ''b'' are denoted
and in
projective geometry two points ''b'' and ''c'' are in
perspective when
while they are connected by a projectivity when
Infix notation is more difficult to
parse by computers than
prefix notation (e.g. + 2 2) or
postfix notation
Reverse Polish notation (RPN), also known as reverse Łukasiewicz notation, Polish postfix notation or simply postfix notation, is a mathematical notation in which operators ''follow'' their operands, in contrast to Polish notation (PN), in whi ...
(e.g. 2 2 +). However many
programming languages use it due to its familiarity. It is more used in arithmetic, e.g. 5 × 6.
Further notations
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 ("sum"): .
Order of operations
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
In mathematics and computer programming, the order of operations (or operator precedence) is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression.
For exampl ...
.
See also
*
Tree traversal: Infix (In-order) is also a tree traversal order. It is described in a more detailed manner on this page.
*
Calculator input methods: comparison of notations as used by pocket calculators
* Postfix notation, also called
Reverse Polish notation
* Prefix notation, also called
Polish notation
*
Shunting yard algorithm, used to convert infix notation to postfix notation or to a tree
*
Operator (computer programming)
References
{{Reflist
External links
''RPN or DAL? A brief analysis of Reverse Polish Notation against Direct Algebraic Logic''Infix to postfix convertor'
ic'
Mathematical notation
Operators (programming)