Skip to main content

factorial

factorial (n)

The factorial function returns n !, where n is assumed to be a positive integer.

Note that while factorial is an integer-valued function, a double-precision number has 53 bits for the mantissa. This means that numbers over 252 will be accurate to about one part in about 2x1016. Values of n greater than 170 result in overflow and return the nonnumber Inf.