The factorial, symbolized by an exclamation mark (!), is a quantity defined for all integer s greater than or equal to 0.

For an integer *n* greater than or equal to 1, the factorial is the product of all integers less than or equal to *n* but greater than or equal to 1. The factorial value of 0 is defined as equal to 1. The factorial values for negative integers are not defined.

Mathematically, the formula for the factorial is as follows. If *n* is an integer greater than or equal to 1, then

*n* ! = *n* ( *n* - 1)( *n* - 2)( *n* - 3) ... (3)(2)(1)

If *p* = 0, then *p* ! = 1 by convention.

The factorial is of interest to number theorists. It often arises in probability calculations, particularly those involving combinations and permutations. The factorial also arises occasionally in calculus and physics.

Compare double factorial .