show factorial equation

This commit is contained in:
Jidong Xiao
2023-09-19 23:11:04 -04:00
parent a3d2476319
commit 6dcb0a83a6

View File

@@ -141,18 +141,18 @@ for (int j=i; j<n; ++j)
## 7.10 Recursive Definitions of Factorials and Integer Exponentiation ## 7.10 Recursive Definitions of Factorials and Integer Exponentiation
Factorial is defined for non-negative integers as: - Factorial is defined for non-negative integers as:
n! = ( ![alt text](factorial_equation.png "factorial equation")
n · (n 1)! n > 0
1 n == 0 - Computing integer powers is defined as:
Computing integer powers is defined as:
n n
p = p =
( (
n · n n · n
p1 p > 0 p1 p > 0
1 p == 0 1 p == 0
These are both examples of recursive definitions
These are both examples of recursive definitions
## 7.11 Recursive C++ Functions ## 7.11 Recursive C++ Functions