Skip to content

Expand stirlings1 and stirlings2 to work with very large integers#84

Closed
wherrera10 wants to merge 2 commits intoJuliaMath:masterfrom
wherrera10:master
Closed

Expand stirlings1 and stirlings2 to work with very large integers#84
wherrera10 wants to merge 2 commits intoJuliaMath:masterfrom
wherrera10:master

Conversation

@wherrera10
Copy link
Copy Markdown

The documentation for stirlings1 and stirlings2 indicates that they can use BigInts if provided with such as argument. However the existing functions specify n and k arguments to be Int. This patch allows support for BigInt integers without breaking type consistency of return types, and also provides for some memoization, since otherwise the functions, since they are recursive, can be slow when handling very large integers.

The functions stirlings1(n, k) and stirlings1(n, k) are currently (mid 2019) written to specify Int arguments for n and k, but the documentation states that they should optionally take a BigInt as well.  This can be fixed by changing them not to specify an Int for n and k.
@wherrera10 wherrera10 changed the title Expand stirlings1 and stirling2 to work with very large integers Expand stirlings1 and stirlings2 to work with very large integers Aug 18, 2019
@mschauer mschauer closed this Nov 11, 2022
mschauer pushed a commit that referenced this pull request Nov 11, 2022
> The documentation for stirlings1 and stirlings2 indicates that they can use BigInts if provided with such as argument. However the existing functions specify n and k arguments to be Int. This patch allows support for BigInt integers without breaking type consistency of return types, and also provides for some memoization, since otherwise the functions, since they are recursive, can be slow when handling very large integers.

(credit https://github.com/wherrera10)
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.40%. Comparing base (38fc5c4) to head (4b2c99a).
⚠️ Report is 72 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master      #84       +/-   ##
===========================================
+ Coverage   75.51%   94.40%   +18.89%     
===========================================
  Files           7        7               
  Lines         637      518      -119     
===========================================
+ Hits          481      489        +8     
+ Misses        156       29      -127     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants