If X is any compact space, let A be a subalgebra of the algebra C(X) over the reals R with binary operations + and ×. Then, if A contains the constant functions and separates the points of X (i.e., for any two distinct points x and y of X, there is some function f in A such that f(x)!=f(y)), A is dense in C(X) equipped with the uniform norm. This theorem is a generalization of the Weierstrass approximation theorem.