Infix notation: Difference between revisions

Content deleted Content added
Gesslein (talk | contribs)
m Undid revision 231010603 by 59.182.234.189 (talk)
 
(90 intermediate revisions by 69 users not shown)
Line 1:
{{Short description|Mathematics notation with operators between operands}}
{{Infobox notation
|{{Operator notation sidebar |logo=[[ImageFile:Infix-dia.pngsvg|125px]]}}
}}'''Infix notation''' is the common arithmetic and logical formula notation, in which [[operator]]s are written [[infix]]-style between the [[operand]]s they act on (e.g. 2 '''+''' 2). It is not as simple to [[Parsing|parse]] by computers as [[prefix notation]] ( e.g. '''+''' 2 2 ) or [[postfix notation]] ( e.g. 2 2 '''+''' ), but many [[programming language]]s use it due to its familiarity.
 
'''Infix notation''' is the notation commonly used in [[arithmetic]]al and [[logic]]al formulae and statements. It is characterized by the placement of [[Operator (mathematics)|operator]]s between [[operand]]s—"infixed operators"—such as the [[plus sign]] in {{nowrap|2 '''+''' 2}}.
In infix notation, unlike in prefix or postfix notations, [[Bracket#Parentheses_.28_.29|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. These are explained in the [[order of operations]] article.
 
==See alsoUsage==
[[Binary relation]]s are often denoted by an infix symbol such as [[set membership]] ''a'' ∈ ''A'' when the set ''A'' has ''a'' for an element. In [[geometry]], [[perpendicular line]]s ''a'' and ''b'' are denoted <math>a \perp b \ ,</math> and in [[projective geometry]] two points ''b'' and ''c'' are in [[perspective (geometry)|perspective]] when <math>b \ \doublebarwedge \ c</math> while they are connected by a projectivity when <math>b \ \barwedge \ c .</math>
*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
 
Infix notation is more difficult to [[parsing|parse]] by computers than [[prefix notation]] (e.g. '''+''' 2 2) or [[postfix notation]] (e.g. 2 2 '''+'''). However many [[programming language]]s use it due to its familiarity. It is more used in arithmetic, e.g. 5 '''×''' 6.<ref name="Infix, Postfix and Prefix">{{cite web | url=http://www.cs.man.ac.uk/~pjj/cs212/fix.html | title=The Implementation and Power of Programming Languages | access-date=30 August 2014 | archive-url=https://web.archive.org/web/20220827171346/https://www.cs.man.ac.uk/~pjj/cs212/fix.html | archive-date=27 August 2022}}</ref>
==External links==
*[http://www.xnumber.com/xnumber/rpn_or_adl.htm ''RPN or DAL? A brief analysis of Reverse Polish Notation against Direct Algebraic Logic'']
 
==Further notations==
{{math-stub}}
Infix notation may also be distinguished from [[Function (mathematics)|function]] notation, where the name of a function suggests a particular operation, and its [[Argument of a function|arguments]] are the operands. An example of such a [[Function application|function notation]] would be {{math|S(1, 3)}} in which the function {{math|S}} denotes addition ("sum"): {{math|1=S (1, 3) = 1 + 3 = 4}}.
[[Category:Mathematical notation]]
 
==Order of operations==
[[cs:Infixová notace]]
In infix notation, unlike in prefix or postfix notations, [[Bracket#Parentheses_.28_.29Parentheses|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. These are explained in the [[order of operations]] article.
[[de:Infixnotation]]
 
[[hr:Infiksna notacija]]
== See also ==
[[ja:中置記法]]
* [[Tree traversal]]: Infix (In-order) is also a tree traversal order. It is described in a more detailed manner on this page.
[[simple:Infix notation]]
* [[Calculator input methods]]: comparison of notations as used by pocket calculators
[[sr:Инфиксна нотација]]
*postfix Postfix notation, also called [[Reverse Polish notation]]
*prefix Prefix notation, also called [[Polish notation]]
* [[Shunting yard algorithm]], used to convert infix notation to postfix notation or to a tree
* [[Operator (computer programming)]]
* [[Subject–verb–object word order]]
 
==References==
{{Reflist}}
 
== External links ==
* [http://www.xnumber.com/xnumber/rpn_or_adl.htm ''RPN or DAL? A brief analysis of Reverse Polish Notation against Direct Algebraic Logic'']
*[https://web.archive.org/web/20130925214440/http://www.meta-calculator.com/learning-lab/how-to-build-scientific-calculator/infix-to-postifix-convertor.php Infix to postfix convertor]''[sic]''
 
[[Category:Mathematical notation]]
[[Category:Operators (programming)]]