Global Information Lookup Global Information

Operator associativity information


In programming language theory, the associativity 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, ^ 3 ^), 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 associative (meaning the operations can be grouped arbitrarily), left-associative (meaning the operations are grouped from the left), right-associative (meaning the operations are grouped from the right) or non-associative (meaning operations cannot be chained, often because the output type is incompatible with the input types). 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 type of operator.

Consider the expression a ~ b ~ c. If the operator ~ has left associativity, this expression would be interpreted as (a ~ b) ~ c. If the operator has right associativity, the expression would be interpreted as a ~ (b ~ c). If the operator is non-associative, the expression might be a syntax error, or it might have some special meaning. Some mathematical operators have inherent associativity. For example, subtraction and division, as used in conventional math notation, are inherently left-associative. Addition and multiplication, by contrast, are both left and right associative. (e.g. (a * b) * c = a * (b * c)).

Many programming language manuals provide a table of operator precedence and associativity; see, for example, the table for C and C++.

The concept of notational associativity described here is related to, but different from, the mathematical associativity. An operation that is mathematically associative, by definition requires no notational associativity. (For example, addition has the associative property, therefore it does not have to be either left associative or right associative.) An operation that is not mathematically associative, however, must be notationally left-, right-, or non-associative. (For example, subtraction does not have the associative property, therefore it must have notational associativity.)

and 24 Related for: Operator associativity information

Request time (Page generated in 0.8242 seconds.)

Operator associativity

Last Update:

In programming language theory, the associativity of an operator is a property that determines how operators of the same precedence are grouped in the...

Word Count : 1351

Common operator notation

Last Update:

operand on the next evaluation level. Each operator is given a position, precedence, and an associativity. The operator precedence is a number (from high to...

Word Count : 826

Associative property

Last Update:

Look up associative property in Wiktionary, the free dictionary. Light's associativity test Telescoping series, the use of addition associativity for cancelling...

Word Count : 3307

Ternary conditional operator

Last Update:

equivalent). The associativity of nested ternary operators can also differ from language to language. In almost all languages, the ternary operator is right associative...

Word Count : 6080

Momentum operator

Last Update:

quantum mechanics, the momentum operator is the operator associated with the linear momentum. The momentum operator is, in the position representation...

Word Count : 2031

Order of operations

Last Update:

Hyperoperation Logical connective#Order of precedence Operator associativity Operator overloading Operator precedence in C and C++ Polish notation Reverse Polish...

Word Count : 4366

Proximal operator

Last Update:

In mathematical optimization, the proximal operator is an operator associated with a proper, lower semi-continuous convex function f{\displaystyle f} from...

Word Count : 731

Operator

Last Update:

Look up operator in Wiktionary, the free dictionary. Operator may refer to: A symbol indicating a mathematical operation Logical operator or logical connective...

Word Count : 506

Logical conjunction

Last Update:

are constructively valid proofs by contradiction. commutativity: yes associativity: yes distributivity: with various operations, especially with or idempotency:...

Word Count : 1334

Algebra over a field

Last Update:

{\displaystyle A\times A\rightarrow A} . The usage of "non-associative" here is meant to convey that associativity is not assumed, but it does not mean it is prohibited...

Word Count : 2913

Closure operator

Last Update:

In mathematics, a closure operator on a set S is a function cl : P ( S ) → P ( S ) {\displaystyle \operatorname {cl} :{\mathcal {P}}(S)\rightarrow {\mathcal...

Word Count : 2664

Creation and annihilation operators

Last Update:

Creation operators and annihilation operators are mathematical operators that have widespread applications in quantum mechanics, notably in the study...

Word Count : 4461

Laplace operator

Last Update:

In mathematics, the Laplace operator or Laplacian is a differential operator given by the divergence of the gradient of a scalar function on Euclidean...

Word Count : 4069

Telephone operator

Last Update:

Look up telephone operator in Wiktionary, the free dictionary. Telephone operator may refer to: Switchboard operator, a person who provides assistance...

Word Count : 123

Formula calculator

Last Update:

multiplication, 3*4, is done first. Among operators with the same precedence, associativity, so that the left-most operator must be applied first. For example...

Word Count : 816

Sobel operator

Last Update:

The Sobel operator, sometimes called the Sobel–Feldman operator or Sobel filter, is used in image processing and computer vision, particularly within...

Word Count : 2562

Logical disjunction

Last Update:

following truth table: The following properties apply to disjunction: Associativity: a ∨ ( b ∨ c ) ≡ ( a ∨ b ) ∨ c {\displaystyle a\lor (b\lor c)\equiv...

Word Count : 1848

Differential operator

Last Update:

In mathematics, a differential operator is an operator defined as a function of the differentiation operator. It is helpful, as a matter of notation first...

Word Count : 3650

Shift operator

Last Update:

{C} } is called a family of generalized shift operators if the following properties hold: Associativity: let ( R y f ) ( x ) = ( L x f ) ( y ) . {\displaystyle...

Word Count : 1452

Singular integral

Last Update:

differential equations. Broadly speaking a singular integral is an integral operator T ( f ) ( x ) = ∫ K ( x , y ) f ( y ) d y , {\displaystyle T(f)(x)=\int...

Word Count : 1582

Array programming

Last Update:

==A^-1 * b       (matrix-multiplication associativity) x = A^-1 * b where == is the equivalence relational operator. The previous statements are also valid...

Word Count : 2529

Shunting yard algorithm

Last Update:

And changing the associativity condition to right. Input: 3 + 4 × 2 ÷ ( 1 − 5 ) ^ 2 ^ 3 The symbol ^ represents the power operator. Input: sin ( max...

Word Count : 1036

Vertex operator algebra

Last Update:

= ε(α, β)eα+β – the cocycle condition on ε ensures associativity of the ring. The vertex operator attached to lowest weight vector vλ in the Fock space...

Word Count : 8900

Operator overloading

Last Update:

programming, operator overloading, sometimes termed operator ad hoc polymorphism, is a specific case of polymorphism, where different operators have different...

Word Count : 1775

PDF Search Engine © AllGlobal.net