Skip to content

Conversation

@fchapoton
Copy link
Contributor

just reading the code there and cleaning a little bit

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.

@github-actions
Copy link

github-actions bot commented Dec 14, 2025

Documentation preview for this PR (built with commit 4e7490d; changes) is ready! 🎉
This preview will update shortly after each push to this PR.


return ZZ(-1)**(n//2 + 1) * ZZ(2)**(n-1) * pi**n * bernoulli(n) / factorial(n)
return ZZ(-1)**(n // 2 + 1) * ZZ(2)**(n - 1) * pi**n * bernoulli(n) / factorial(n)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the else could be removed

if n == 1:
return infinity
elif n == 0:
if n == 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is redundant. we have checked before whether n < 0, n > 1 and n == 1. So it remains only 0, right ?

return QuadraticBernoulliNumber(1-n, d)/(n-1)
elif n >= 1:
return QuadraticBernoulliNumber(1 - n, d) / (n - 1)
if n >= 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to check n >= 1 ? we have already tested whether n <= 0.

Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants