Tuesday, August 4, 2009

factorial

Factorial function

Syntax

*

factorial(n)

Description

factorial(n) is the product of all the integers from 1 to n, i.e. prod(1:n). Since double pricision numbers only have about 15 digits, the answer is only accurate for n <= 21. For larger n, the answer will have the right magnitute, and is accurate for the first 15 digits.

No comments:

Post a Comment