HomePage | Recent changes | View source | Discuss this page | Page history | Log in |

Printable version | Disclaimers | Privacy policy

In computing, the term idempotent refers to something which has the same effect if used multiple times as it does if used only once. In particular, C header files are often designed to be idempotent, that is, if the header file is included more than once (as can easily happen with nested #includes), then nothing untoward happens - the effect is the same as if it had been included only once. In HTTP, some methods (such as GET) are idempotent, while other methods (such as POST) are not.

The above meaning derives from the following meaning in mathematics. A function f from a set S to itself is idempotent if f o f = f, that is, f(f(x)) = f(x) for all x in S. This is equivalent to saying that f(x) = x for all x in f(S). Trivial examples of idempotent functions on S are the identity map and the constant maps. Less trivial examples are the absolute value function of a real or complex argument, and the closure operator for a topological space X, which is an idempotent function on the power set of X.

More generally, if S is a set with a binary operation * on it, then an element s of S is said to be idempotent if s * s = s. An idempotent element is often just called an idempotent. For example, any identity element is an idempotent. If every element of S is idempotent, then S itself (or the binary operation *) is said to be idempotent. For example, the operations of set union and set intersection are idempotent.