Infix-Notation

Infix-Notation

Die allgemein gebräuchliche Schreibweise von Rechenoperationen und formalen logischen Ausdrücken wird als Infixnotation bezeichnet, da sie die Operatoren zwischen die Operanden setzt. Zum Beispiel:

1 + 2 · 8 ÷ 12

Allerdings kann diese Darstellung zu Verwirrung führen, da das Ergebnis von der Reihenfolge der Abarbeitung der Rechenoperationen abhängen kann. Bei o. g. Beispiel sind z. B. folgende Abarbeitungen denkbar:

  • von links nach rechts
1 + 2 = 3
3 · 8 = 24
24 ÷ 12 = 2
  • Punkt- vor Strich-Rechnung (allgemein gebräuchliche Form)
2 · 8 = 16
16 ÷ 12 = 1,333...
1 + 1,333... = 2,333...

Doch auch da gibt es noch Mehrdeutigkeiten, zum Beispiel bei 1÷2·3:

  • von rechts nach links als 1÷(2·3):
2 · 3 = 6
1 ÷ 6 = 0,1666...
  • von links nach rechts als (1÷2)·3 (allgemein gebräuchliche Form)
1 ÷ 2 = 0,5
0,5 · 3 = 1,5

Man hat sich deshalb bei der Infixnotation auf bestimmte Regeln zur Abarbeitung komplexerer Rechenoperationen geeinigt. Diese legen Prioritäten für einzelne Operatoren-Gruppen fest. So wird zum Beispiel Punktrechnung (Multiplikation, Division) vor der Strichrechnung (Addition, Subtraktion) ausgeführt. Treffen mehrere Punktrechnungen oder mehrere Strichrechnungen aufeinander, dann werden sie von links nach rechts ausgewertet; man sagt, die betroffenen Operatoren sind linksassoziativ.

Noch vor den Punktrechnungen werden Potenzierungen ausgewertet, sodass z.B. a\cdot b^c=a\cdot (b^c) ist. Die Potenzierung ist zudem rechtsassoziativ, wird also im Gegensatz zu Punkt- und Strichrechnungen von rechts nach links ausgewertet. Das bedeutet, dass zum Beispiel der Ausdruck a^{b^{c^d}} als a^{(b^{(c^d)})} gelesen werden muss.

Um die solcherart vordefinierte Operatorrangfolge zu verändern, benutzt man unterschiedliche Arten von Gliederungszeichen, wie die hier schon verwendeten Klammern. Mehr zum Thema der Gliederungszeichen siehe Operatorrangfolge: Gliederungszeichen.

Siehe auch


Wikimedia Foundation.

Игры ⚽ Поможем написать реферат

Schlagen Sie auch in anderen Wörterbüchern nach:

  • infix notation — in fix no*ta tion, n. (Computers) A notation for commands or instructions in which the operator is inserted between the terms on which it operates. Contrasted with {prefix notation} and {postfix notation} …   The Collaborative International Dictionary of English

  • Infix notation — Infobox notation logo=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). It is not as simple to parse by computers as prefix notation ( e …   Wikipedia

  • infix notation — noun a notation for forming mathematical expressions using parentheses and governed by rules of operator precedence; operators are dispersed among the operands • Hypernyms: ↑mathematical notation * * * infix notation noun A form of algebraic… …   Useful english dictionary

  • infix notation — infiksinis užrašas statusas T sritis informatika apibrėžtis ↑Dvivietės operacijos užrašas, kai operacijos ženklas rašomas tarp operandų. Pavyzdžiui, a+b, a/b, a{{b. atitikmenys: angl. infix notation ryšiai: dar žiūrėk – dvivietė operacija… …   Enciklopedinis kompiuterijos žodynas

  • infix notation — noun Notation where operators appear between operands, for example a+b …   Wiktionary

  • Notation — The term notation can refer to: Contents 1 Written communication 1.1 Biology and Medicine 1.2 Chemistry 1.3 Dance and movement …   Wikipedia

  • infix — I. transitive verb Etymology: Latin infixus, past participle of infigere, from in + figere to fasten more at fix Date: 1502 1. to fasten or fix by piercing or thrusting in 2. to impress firmly in the consciousness or disposition 3. to insert (as… …   New Collegiate Dictionary

  • infix — 1. verb /ˈɪnfɪks,ɪnˈfɪks/ a) To instill. b) To insert a morpheme inside an existing word. 2. noun /ˈɪnfɪks,ɪnˈfɪks/ A morpheme inserted inside an existing word, such as and in English. See Also …   Wiktionary

  • Notation (Mathematik) — Als Notation bezeichnet man in Mathematik, Logik und Informatik die Schreibweise von Formeln und Ausdrücken mittels mathematischer Symbole. Die mathematische Notation entspricht einer Sprache, die formaler ist als viele natürliche Sprachen und… …   Deutsch Wikipedia

  • Notation infixée — Notations infixée, préfixée, polonaise et postfixée La notation infixée est la forme d écriture standard des expressions mathématiques dans laquelle les opérateurs sont écrits entre les opérandes, par exemple 2 + ( 5 3 ). La notation préfixée est …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”