-
Notifications
You must be signed in to change notification settings - Fork 191
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 for large numbers #628
Conversation
factorials of numbers larger than 170 do not fit into a int, hence return float using the qarg `exact=True` when needed
Codecov Report
@@ Coverage Diff @@
## master #628 +/- ##
=======================================
Coverage 98.55% 98.55%
=======================================
Files 77 77
Lines 8987 8989 +2
=======================================
+ Hits 8857 8859 +2
Misses 130 130
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch @sduquemesa! Don't forget to add this to the changelog before merging it in 🙂
remove unneeded `else` statement Co-authored-by: Josh Izaac <josh146@gmail.com>
test case for large numbers
Context: Factorials of numbers larger than 170 do not fit into an
int
, hence return float when neededDescription of the Change: use the
qarg exact=True/False
onscipy.special.factorial
when the result cannot be fitted inside anint
Benefits: Error won't be raised when
factorial
is called with a large numberPossible Drawbacks: None
Related GitHub Issues: #284