Skip to content

Commit 6039c87

Browse files
Update math/iterative_factorial.cpp
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
1 parent 651432c commit 6039c87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

math/iterative_factorial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ uint64_t iterativeFactorial(uint8_t n) {
5050
// 1 because it is the identity number of multiplication.
5151
uint64_t accumulator = 1;
5252

53-
while (n > 0) {
53+
while (n > 1) {
5454
accumulator *= n;
5555
--n;
5656
}

0 commit comments

Comments
 (0)