Infix notation
   HOME

TheInfoList



OR:

Infix notation is the notation commonly used in arithmetical and
logic Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premise ...
al formulae and statements. It is characterized by the placement of operators between
operand In mathematics, an operand is the object of a mathematical operation, i.e., it is the object or quantity that is operated on. Example The following arithmetic expression shows an example of operators and operands: :3 + 6 = 9 In the above exam ...
s—" infixed operators"—such as the plus sign in .


Usage

Binary relations are often denoted by an infix symbol such as set membership ''a'' ∈ ''A'' when the set ''A'' has ''a'' for an element. In
geometry Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space such as the distance, shape, size, and relative position of figures. A mathematician who works in the field of geometry is ...
, perpendicular lines ''a'' and ''b'' are denoted a \perp b \ , and in
projective geometry In mathematics, projective geometry is the study of geometric properties that are invariant with respect to projective transformations. This means that, compared to elementary Euclidean geometry, projective geometry has a different setting, ...
two points ''b'' and ''c'' are in perspective when b \ \doublebarwedge \ c while they are connected by a projectivity when b \ \barwedge \ c . Infix notation is more difficult to
parse Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Lat ...
by computers than
prefix notation Polish notation (PN), also known as normal Polish notation (NPN), Łukasiewicz notation, Warsaw notation, Polish prefix notation or simply prefix notation, is a mathematical notation in which operators ''precede'' their operands, in contrast t ...
(e.g. + 2 2) or postfix notation (e.g. 2 2 +). However many
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s 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 Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
notation, where the name of a function suggests a particular operation, and its
arguments An argument is a statement or group of statements called premises intended to determine the degree of truth or acceptability of another statement called conclusion. Arguments can be studied from three main perspectives: the logical, the dialectic ...
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 A bracket is either of two tall fore- or back-facing punctuation marks commonly used to isolate a segment of text or data from its surroundings. Typically deployed in symmetric pairs, an individual bracket may be identified as a 'left' or 'r ...
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.


See also

*
Tree traversal In computer science, tree traversal (also known as tree search and walking the tree) is a form of graph traversal and refers to the process of visiting (e.g. retrieving, updating, or deleting) each node in a tree data structure, exactly once. ...
: Infix (In-order) is also a tree traversal order. It is described in a more detailed manner on this page. *
Calculator input methods There are various ways in which calculators interpret keystrokes. These can be categorized into two main types: * On a single-step or immediate-execution calculator, the user presses a key for each operation, calculating all the intermediate resu ...
: comparison of notations as used by pocket calculators * Postfix notation, also called
Reverse Polish 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 ...
* Prefix notation, also called
Polish notation Polish notation (PN), also known as normal Polish notation (NPN), Łukasiewicz notation, Warsaw notation, Polish prefix notation or simply prefix notation, is a mathematical notation in which operators ''precede'' their operands, in contrast ...
*
Shunting yard algorithm In computer science, the shunting yard algorithm is a method for parsing arithmetical or logical expressions, or a combination of both, specified in infix notation. It can produce either a postfix notation string, also known as Reverse Polish ...
, used to convert infix notation to postfix notation or to a tree *
Operator (computer programming) In computer programming, operators are constructs defined within programming languages which behave generally like functions, but which differ syntactically or semantically. Common simple examples include arithmetic (e.g. addition with ), c ...


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)