trekhleb / trekhleb/javascript-algorithms
Factorial of a negative number does not exist
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 197k
- Forks
- 31k
- PR merge metrics
- No merged PRs in 30d
Description
This issue is addressing the fact that in the factorialrecursive implementation, it says if number is not greater than 1 then return 1. its not true for all cases cox fact of a neative is undefined.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the factorialrecursive implementation referenced in the issue and read its surrounding tests or usage. Review the comment discussion for the expected behavior for negative inputs, then confirm the chosen behavior with focused tests covering negative, zero, and positive numbers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100