In programming languages and mathematical notation, the associativity (or fixity) of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. If an operand is both preceded and followed by operators (for example, "^ 4 ^"), and those operators have equal precedence, then the operand may be used as input to two different operations (i.e. the two operations indicated by the two operators).

PropertyValue
dbpedia-owl:abstract
  • Operatorassoziativität bezeichnet vor allem in der Informatik, aber auch in Mathematik und Logik: im engeren Sinn die Eigenschaft eines Operators, dass die Reihenfolge, mit der mehrere Vorkommnisse dieses Operators in einem Ausdruck ausgewertet werden, keinen Einfluss auf das Ergebnis der Auswertung hat, das heißt, dass für ihn das Assoziativgesetz (a ∘ b) ∘ c = a ∘ (b ∘ c) gilt; im weiteren Sinn die Festlegung, auf welche Weise ein nicht im engeren Sinn assoziativer Operator ausgewertet werden soll. Zum Beispiel sind in der Mathematik die Addition und Multiplikation assoziative Operatoren, weil und ist. In der Logik sind zum Beispiel Konjunktion und Disjunktion assoziativ, weil einerseits und und andererseits und äquivalent sind. Nicht assoziativ sind zum Beispiel Division und Konditional, weil im Allgemeinen ist und weil und nicht äquivalent sind. Erst bei nicht assoziativen Verknüpfungen hängt das Ergebnis von der Operatorassoziativität ab. Um zu vermeiden, dass Ausdrücke mit nebeneinander stehenden, gleichwertigen Operatoren ohne Klammerung mehrdeutig sind, wird eine Assoziativität per Konvention festgelegt: Ein Linksassoziativer Operator wird von links nach rechts ausgewertet. Ein Beispiel ist die Subtraktion: Es ist . Das Konditional in der Logik wird von den meisten Autoren linksassoziativ verwendet, das heißt dass als zu lesen ist. Ein Rechtsassoziativer Operator wird von rechts nach links ausgewertet. Beispiele hierfür: Die Potenzierung in der Mathematik: Der Zuweisungsoperator verschiedener Programmiersprachen wie beispielsweise C: ist gleichbedeutend mit, das heißt der Variablen wird zunächst der Wert von zugewiesen und das Ergebnis dieser Zuweisung (das gleich dem zugewiesenen Wert ist) anschließend zugewiesen. In Programmiersprachen, die Seiteneffekte in Ausdrücken erlauben, ist die Reihenfolge, in der diese Seiteneffekte ausgeführt/wirksam werden, von Bedeutung. Einige Programmiersprachen legen diese Auswertungsreihenfolge strikt fest, andere lassen die Auswertungsreihenfolge bei den meisten Infix-Operanden undefiniert. Beispiel: Siehe auch:
  • In programming languages and mathematical notation, the associativity (or fixity) of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. If an operand is both preceded and followed by operators (for example, "^ 4 ^"), and those operators have equal precedence, then the operand may be used as input to two different operations (i.e. the two operations indicated by the two operators). The choice of which operations to apply the operand to, is determined by the "associativity" of the operators. Operators may be left-associative (meaning the operations are grouped from the left), right-associative (meaning the operations are grouped from the right) or non-associative (meaning there is no defined grouping). The associativity and precedence of an operator is a part of the definition of the programming language; different programming languages may have different associativity and precedence for the same operator symbol. Consider the expression a ~ b ~ c. If the operator ~ has left associativity, this expression would be interpreted as (a ~ b) ~ c and evaluated left-to-right. If the operator has right associativity, the expression would be interpreted as a ~ (b ~ c) and evaluated right-to-left. If the operator is non-associative, the expression might be a syntax error, or it might have some special meaning. Many programming language manuals provide a table of operator precedence and associativity; see, for example, the table for C and C++.
  • Em Linguagens de programação e Notação matemática, a associatividade de um operador é uma propriedade que determina como operadores de mesma precedência são agrupados na ausência de parêntesis. Operadores podem ser associativos-à-esquerda, associativos-à-direita ou não-associativos. A associatividade e a precedência de um operador depende da linguagem de programação em questão. Considere a expressão a ~ b ~ c. Se o operador ~ tem associatividade à esquerda, essa expressão seria interpretada como (a ~ b) ~ c e avaliada da esquerda para a direita. Se o operador tem associatividade à direita, a expressão seria interpretada como a ~ (b ~ c) e avaliada da direita para a esquerda. Se o operador não é associativo, a expressão pode resultar em um erro de sintaxe, como no caso do operador de exponenciação ** da linguagem de programação Ada, ou pode ter algum significado especial. Muitos manuais de linguagem de programação fornecem uma tabela de precedência dos operadores e associatividade, ver, por exemplo, tabela de C e C ++.
  • Ассоциативность В математике — свойство любой операции, такое что для неё выполняется равенство: для любых элементов . Например, для умножения: . В программировании ассоциативностью операторов называют последовательность их выполнения (или направление вычисления), реализуемое, когда операторы имеют одинаковый приоритет и отсутствует явное (с помощью скобок) указание на очерёдность их выполнения. При этом различается левая ассоциативность, при которой вычисление выражения происходит слева-направо, и правая ассоциативность — справа-налево. Соответствующие операторы называют левоассоциативными и правоассоциативными. Например, в языке Python большинство операторов имеет левую ассоциативность, в то время как возведение в степень правоассоциативно: Правая ассоциативность (вычисление выражения справа-налево), возведение в степень в языке Python: Левая ассоциативность (вычисление выражения слева-направо), побитовый сдвиг в языке Python:
dcterms:subject
rdf:type
rdfs:comment
  • Operatorassoziativität bezeichnet vor allem in der Informatik, aber auch in Mathematik und Logik: im engeren Sinn die Eigenschaft eines Operators, dass die Reihenfolge, mit der mehrere Vorkommnisse dieses Operators in einem Ausdruck ausgewertet werden, keinen Einfluss auf das Ergebnis der Auswertung hat, das heißt, dass für ihn das Assoziativgesetz (a ∘ b) ∘ c = a ∘ (b ∘ c) gilt; im weiteren Sinn die Festlegung, auf welche Weise ein nicht im engeren Sinn assoziativer Operator ausgewertet werden soll.
  • Em Linguagens de programação e Notação matemática, a associatividade de um operador é uma propriedade que determina como operadores de mesma precedência são agrupados na ausência de parêntesis. Operadores podem ser associativos-à-esquerda, associativos-à-direita ou não-associativos. A associatividade e a precedência de um operador depende da linguagem de programação em questão. Considere a expressão a ~ b ~ c.
  • Ассоциативность В математике — свойство любой операции, такое что для неё выполняется равенство: для любых элементов . Например, для умножения: . В программировании ассоциативностью операторов называют последовательность их выполнения (или направление вычисления), реализуемое, когда операторы имеют одинаковый приоритет и отсутствует явное (с помощью скобок) указание на очерёдность их выполнения.
  • In programming languages and mathematical notation, the associativity (or fixity) of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. If an operand is both preceded and followed by operators (for example, "^ 4 ^"), and those operators have equal precedence, then the operand may be used as input to two different operations (i.e. the two operations indicated by the two operators).
rdfs:label
  • Operatorassoziativität
  • Operator associativity
  • Associatividade de operadores
  • Ассоциативность
owl:sameAs
foaf:page
is dbpedia-owl:wikiPageRedirects of
is owl:sameAs of
is foaf:primaryTopic of