-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factorial of a negative number does not exist #1008
Comments
I have solved this already check PR for merged |
Hi there, I want to contribute to this project and take on this issue as my first task. Could you please assign it to me? I am excited to work towards resolving it and will keep the team updated on my progress. Thanks! |
Please link your PR to this issue. |
This issue pertains to the factorial recursive implementation. Currently, the implementation states that if the number is not greater than 1, it should return 1. However, this is not entirely accurate because the factorial of a negative number is undefined. DGme |
Hi is this issue still open |
No check there is a PR for the issue already.
…On Mon, 15 May 2023 at 18:11 Utkarsh Shrivastav ***@***.***> wrote:
Hi is this issue still open
—
Reply to this email directly, view it on GitHub
<#1008 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWTKIXIJT6FZ53LQUI2D4E3XGJPVLANCNFSM6AAAAAAV54MKEU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That is correct. The factorial of a negative number does not exist. The factorial function is defined as the product of all positive integers less than or equal to a given number. Since negative numbers are not positive, they cannot be part of the product. Therefore, the factorial of a negative number is undefined. Here are some examples of factorials of positive integers: 1! = 1 (-1)! = undefined |
the factorial recursive implementation, the statement that returns 1 when the number is not greater than 1 is not suitable for all cases. This is because the factorial of a negative number is undefined. It's important to handle negative numbers as a special case and either return an error or provide appropriate validation to prevent undefined behavior in the factorial function. I would invite you to visit my blog for more informative updates getmyccpay.com |
The GPT spam era is starting |
Facing an issue after pulling code from GitHub while running npm run lint |
您的信件已经收到,我会尽快查阅,谢谢! ——林泽鹏
This is an automatic reply, confirming that your e-mail was received.Thank you
|
Yes I agree the base case in the recurssive statement should state if number <=1 return 1 which handles pretty much everythin |
I agree with the person stated that the factorial of number <0 i.e, -1!, -2!,... all results undefined whereas the values of -0!,0! and 1! results as 1 and the rest continues |
Assign it to me |
Hii I am interested in solving this issue |
I have solved this issue take a look at my PR |
This has been solved already.
…On Thu, 20 Jun 2024 at 15:22 Sanil Surve ***@***.***> wrote:
I have solved this issue take a look at my PR
—
Reply to this email directly, view it on GitHub
<#1008 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWTKIXIRZLKUENOURMUEPODZILQUBAVCNFSM6AAAAAAV54MKEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBQHA2DAOJUHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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.
The text was updated successfully, but these errors were encountered: