Computes the factorial of a given number.
The factorial of a positive integer is the product of all positive integers less than and equal to that number, and the factorial of 0 is 1. The factorial of a natural number n is written n!
Factorial is calculated as follows:
n! = n × (n-1) × (n-2) × ... × 2 × 1