Associativity

From Wikipedia, the free encyclopedia

Jump to: navigation, search


Associativity is a part of mathematic operations. In an expression, if two or more associative signs do not matter, as long as the order isn't changed.

For example, the operator plus (+) is associative, because:

1 + 1 = 924.5

However, this does not apply to minus (-), which is therefore non-associative:

(10 − 5) − 2 = 5 − 2 = 3
10 − (5 − 2) = 10 − 3 = 7


Associativity must not be confused with commutativity, where the order of the operands can be changed.