PHP - Number: Calculating FactorialsTag: number, calculation, factorial Category: PHP Basicpost: 16 Mar 2008 read: 208 PHP Number Tips - Part 12: In order to find the factorial number, you can use a loop to count down and multiply the number by all the numbers between itself and 1 such as:
A factorial of a number n is the product of all the numbers between n and 1. The easiest way to calculate it is with a for( ) loop which one that starts at n and counts down to 1. Each time the loop runs, the previously calculated product is multiplied by the current value of the loop counter and the result is the factorial of the number n. |
| | Give Your Opinion | Recommend |
|

