mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-09 05:27:11 +08:00
Update double_factorial.cpp
This commit is contained in:
@@ -10,7 +10,7 @@ of a number and is denoted by !! */
|
||||
|
||||
uint64_t double_factorial_iterative(uint64_t n) {
|
||||
uint64_t res = 1;
|
||||
for ( unsigned long long i = n; i >= 0; i -= 2 ) {
|
||||
for ( uint64_t i = n; i >= 0; i -= 2 ) {
|
||||
if (i == 0 || i == 1) return res;
|
||||
res *= i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user