Compare commits

...

2 Commits

Author SHA1 Message Date
V0id
0be2d8a7be
Merge 85abf3400d into 9046d80bdb 2024-07-13 21:02:27 +02: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;
}