Skip to content

Conversation

@inkydragon
Copy link
Member

@inkydragon inkydragon commented Nov 20, 2025

#187

Add new doc for

  • bellnum
  • fibonaccinum
  • jacobisymbol
  • legendresymbol
  • lucasnum

Update doc for

  • catalannum
  • lobbnum
  • narayana
  • lassallenum
  • stirlings1
  • stirlings2

Add more tests for

  • catalannum
  • fibonaccinum
  • lassallenum

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.17%. Comparing base (65d2de7) to head (5a7eb67).

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.
📢 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.

@inkydragon inkydragon added the doc documentation label Nov 20, 2025
@inkydragon inkydragon added this to the v1.1.0 milestone Nov 20, 2025
@inkydragon inkydragon marked this pull request as ready for review November 22, 2025 07:44
@inkydragon inkydragon requested a review from Copilot December 8, 2025 14:46
Copy link

Copilot AI left a 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, and lucasnum
  • Updated documentation for catalannum, lobbnum, narayana, lassallenum, stirlings1, and stirlings2 with mathematical formulas, detailed examples, and DLMF/Wikipedia references
  • Expanded test coverage for catalannum, fibonaccinum, and lassallenum with additional test cases and edge cases
  • Improved error messages by adding descriptive text to DomainError exceptions (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.

Comment on lines +414 to +417
julia> n=9; stirlings1(n, 1) == factorial(n-1)
true
julia> n=233; stirlings1(n, n-1) == binomial(n,2)
Copy link

Copilot AI Dec 8, 2025

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
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]
Copy link

Copilot AI Dec 8, 2025

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.

Suggested change
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]

Copilot uses AI. Check for mistakes.
julia> n=9; stirlings1(n, 1) == factorial(n-1)
true
julia> n=233; stirlings1(n, n-1) == binomial(n,2)
Copy link

Copilot AI Dec 8, 2025

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.

Suggested change
julia> n=233; stirlings1(n, n-1) == binomial(n,2)
julia> n=233; stirlings1(n, n-1) == binomial(n, 2)

Copilot uses AI. Check for mistakes.
julia> stirlings2(0, 0)
1
julia> n=233; stirlings2(n, 0) == 0 # n > 0
Copy link

Copilot AI Dec 8, 2025

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.

Copilot uses AI. Check for mistakes.
julia> stirlings2(0, 1)
0
julia> n=13; stirlings2(n, 1) == stirlings2(n, n) == 1 # n > 0
Copy link

Copilot AI Dec 8, 2025

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.

Copilot uses AI. Check for mistakes.
end

"""
narayana(n,k)
Copy link

Copilot AI Dec 8, 2025

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).

Suggested change
narayana(n,k)
narayana(n, k)

Copilot uses AI. Check for mistakes.
n = BigInt(bn)
k = BigInt(bk)
end
div(binomial(n, k)*binomial(n, k - 1) , n)
Copy link

Copilot AI Dec 8, 2025

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).

Suggested change
div(binomial(n, k)*binomial(n, k - 1) , n)
div(binomial(n, k)*binomial(n, k - 1), n)

Copilot uses AI. Check for mistakes.
julia> stirlings1(6, 3, true)
-225
julia> [stirlings1(n,k,true) for n in 1:6, k in 1:6]
Copy link

Copilot AI Dec 8, 2025

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.

Suggested change
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]

Copilot uses AI. Check for mistakes.

# lassalle
# https://oeis.org/A180874
@test lassallenum.(1:10) == [1,1,5,56,1092,32670,1387815,79389310,5882844968,548129834616]
Copy link

Copilot AI Dec 8, 2025

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).

Suggested change
@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]

Copilot uses AI. Check for mistakes.
julia> stirlings1(5, 5) # s(n, n) = 1
1
julia> n=9; stirlings1(n, 1) == factorial(n-1)
Copy link

Copilot AI Dec 8, 2025

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).

Suggested change
julia> n=9; stirlings1(n, 1) == factorial(n-1)
julia> n = 9; stirlings1(n, 1) == factorial(n-1)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant