Closed deljohnson1 closed 1 year ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Is this issue closed ? I can take it up if not complete.
You can have it.
From: Mandeep Singh @.> Sent: Wednesday, April 12, 2023 1:20 PM To: TheAlgorithms/C-Sharp @.> Cc: deljohnson1 @.>; Assign @.> Subject: Re: [TheAlgorithms/C-Sharp] Factorial.cs (Issue #380)
Is this issue closed ? I can take it up if not complete.
— Reply to this email directly, view it on GitHub https://github.com/TheAlgorithms/C-Sharp/issues/380#issuecomment-1505728580 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A5NU4AB7M2R7HI2ITL5XK33XA3W4NANCNFSM6AAAAAAUZD5JNA . You are receiving this because you were assigned.Message ID: @.***>
It's being worked on in https://github.com/TheAlgorithms/C-Sharp/pull/390
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
The Algorithms.Numeric.Factorial.Calculate function takes an int as input and returns a long; the function will overflow with an input greater than 20. Calculate should take a BigInteger as input and return one as output.
Additionally, the function checks input for less than zero. I would recommend putting input error checking outside of the Calculate function, in the ap[plications code (not the library), so that iterative functions that call it don't take the performance hit. In this case I would merely state it in the comment.
I have made the change in my test environment and it appears the change only breaks the Maclaurin.cs file; the fix for this appears to be to perform explicit type conversion on the return result.
I can submit the corrections if desired.