-
Notifications
You must be signed in to change notification settings - Fork 61
doc: add and update doc for numbers.jl
#201
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
base: master
Are you sure you want to change the base?
Conversation
a1d5802 to
fd4f82d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #201 +/- ##
=======================================
Coverage 97.17% 97.17%
=======================================
Files 8 8
Lines 813 813
=======================================
Hits 790 790
Misses 23 23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull request overview
This PR enhances the documentation for special number functions in numbers.jl by adding comprehensive docstrings with mathematical formulas, examples, and references, while also expanding test coverage.
Key changes:
- Added new documentation with examples and references for
bellnum,fibonaccinum,jacobisymbol,legendresymbol, andlucasnum - Updated documentation for
catalannum,lobbnum,narayana,lassallenum,stirlings1, andstirlings2with mathematical formulas, detailed examples, and DLMF/Wikipedia references - Expanded test coverage for
catalannum,fibonaccinum, andlassallenumwith additional test cases and edge cases - Improved error messages by adding descriptive text to
DomainErrorexceptions (e.g., "n must be nonnegative")
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
| src/numbers.jl | Added comprehensive documentation for 5 functions and updated documentation for 6 existing functions with mathematical formulas, examples, and references; improved error messages with descriptive text |
| test/numbers.jl | Reorganized tests by moving bellnum tests to the beginning; added extensive test coverage for catalannum, fibonaccinum, and lassallenum with edge cases and large values |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| julia> n=9; stirlings1(n, 1) == factorial(n-1) | ||
| true | ||
| julia> n=233; stirlings1(n, n-1) == binomial(n,2) |
Copilot
AI
Dec 8, 2025
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.
Missing spaces around assignment operator. Should be n = 233 instead of n=233 to follow Julia style conventions.
| julia> n=9; stirlings1(n, 1) == factorial(n-1) | |
| true | |
| julia> n=233; stirlings1(n, n-1) == binomial(n,2) | |
| julia> n = 9; stirlings1(n, 1) == factorial(n-1) | |
| true | |
| julia> n = 233; stirlings1(n, n-1) == binomial(n,2) |
| julia> n=6; sum(stirlings2(6, k) for k in 0:6) == bellnum(n) | ||
| true | ||
| julia> [stirlings2(n,k) for n in 1:6, k in 1:6] |
Copilot
AI
Dec 8, 2025
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.
Missing spaces after commas in function call. Should be [stirlings2(n, k) for n in 1:6, k in 1:6] to be consistent with Julia style conventions.
| julia> [stirlings2(n,k) for n in 1:6, k in 1:6] | |
| julia> [stirlings2(n, k) for n in 1:6, k in 1:6] |
| julia> n=9; stirlings1(n, 1) == factorial(n-1) | ||
| true | ||
| julia> n=233; stirlings1(n, n-1) == binomial(n,2) |
Copilot
AI
Dec 8, 2025
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.
Missing space after comma in function call. Should be binomial(n, 2) to be consistent with Julia style conventions used elsewhere in the documentation.
| julia> n=233; stirlings1(n, n-1) == binomial(n,2) | |
| julia> n=233; stirlings1(n, n-1) == binomial(n, 2) |
| julia> stirlings2(0, 0) | ||
| 1 | ||
| julia> n=233; stirlings2(n, 0) == 0 # n > 0 |
Copilot
AI
Dec 8, 2025
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.
Missing spaces around assignment operator. Should be n = 233 instead of n=233 to follow Julia style conventions.
| julia> stirlings2(0, 1) | ||
| 0 | ||
| julia> n=13; stirlings2(n, 1) == stirlings2(n, n) == 1 # n > 0 |
Copilot
AI
Dec 8, 2025
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.
Missing spaces around assignment operator. Should be n = 13 instead of n=13 to follow Julia style conventions.
| end | ||
|
|
||
| """ | ||
| narayana(n,k) |
Copilot
AI
Dec 8, 2025
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.
Missing space after comma in function signature documentation. Should be narayana(n, k) to match the updated style used in other function signatures in this PR (e.g., lobbnum(m, n) on line 100).
| narayana(n,k) | |
| narayana(n, k) |
| n = BigInt(bn) | ||
| k = BigInt(bk) | ||
| end | ||
| div(binomial(n, k)*binomial(n, k - 1) , n) |
Copilot
AI
Dec 8, 2025
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.
Extra space before comma. Should be binomial(n, k - 1), n) (remove the space before the comma after k - 1).
| div(binomial(n, k)*binomial(n, k - 1) , n) | |
| div(binomial(n, k)*binomial(n, k - 1), n) |
| julia> stirlings1(6, 3, true) | ||
| -225 | ||
| julia> [stirlings1(n,k,true) for n in 1:6, k in 1:6] |
Copilot
AI
Dec 8, 2025
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.
Missing spaces after commas in function call. Should be [stirlings1(n, k, true) for n in 1:6, k in 1:6] to be consistent with Julia style conventions.
| julia> [stirlings1(n,k,true) for n in 1:6, k in 1:6] | |
| julia> [stirlings1(n, k, true) for n in 1:6, k in 1:6] |
|
|
||
| # lassalle | ||
| # https://oeis.org/A180874 | ||
| @test lassallenum.(1:10) == [1,1,5,56,1092,32670,1387815,79389310,5882844968,548129834616] |
Copilot
AI
Dec 8, 2025
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.
Missing spaces after commas in the array. Should be [1, 1, 5, 56, 1092, 32670, 1387815, 79389310, 5882844968, 548129834616] to be consistent with Julia style conventions and other tests in this file (e.g., line 24, 32).
| @test lassallenum.(1:10) == [1,1,5,56,1092,32670,1387815,79389310,5882844968,548129834616] | |
| @test lassallenum.(1:10) == [1, 1, 5, 56, 1092, 32670, 1387815, 79389310, 5882844968, 548129834616] |
| julia> stirlings1(5, 5) # s(n, n) = 1 | ||
| 1 | ||
| julia> n=9; stirlings1(n, 1) == factorial(n-1) |
Copilot
AI
Dec 8, 2025
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.
Missing space after semicolon in compound statement. Should be n=9; stirlings1(n, 1) == factorial(n-1) → n = 9; stirlings1(n, 1) == factorial(n-1) to follow Julia style conventions (spaces around assignment operators).
| julia> n=9; stirlings1(n, 1) == factorial(n-1) | |
| julia> n = 9; stirlings1(n, 1) == factorial(n-1) |
#187
Add new doc for
bellnumfibonaccinumjacobisymbollegendresymbollucasnumUpdate doc for
catalannumlobbnumnarayanalassallenumstirlings1stirlings2Add more tests for
catalannumfibonaccinumlassallenum