Compare commits

...

2 Commits

Author SHA1 Message Date
V0id
6475244043
Merge 85abf3400d into 2c67b48c21 2024-03-09 16:08:15 -07:00
V0id
85abf3400d Issue #1008 factorial of negative number is negative 2024-01-16 01:50:23 +05:30

View File

@ -3,5 +3,5 @@
* @return {number}
*/
export default function factorialRecursive(number) {
return number > 1 ? number * factorialRecursive(number - 1) : 1;
return number > 1 ? number * factorialRecursive(number - 1) : -1;
}