Skip to content

Commit c8eec4a

Browse files
Update math/iterative_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
1 parent cdd1f20 commit c8eec4a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

math/iterative_factorial.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
* @description Calculates factorial iteratively.
88
* https://en.wikipedia.org/wiki/Factorial
99
*
10-
* Factorial formula:
11-
* n! = n * (n - 1) * (n - 2) * ... * 2 * 1
10+
* \f[n! = n\times(n-1)\times(n-2)\times(n-3)\times\ldots\times3\times2\times1
11+
* = n\times(n-1)!\f]
12+
* for example:
13+
* \f$4! = 4\times3! = 4\times3\times2\times1 = 24\f$
1214
*
1315
* @example
1416
*

0 commit comments

Comments
 (0)