-
-
Notifications
You must be signed in to change notification settings - Fork 728
a few minor details in special_values.py #41293
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: develop
Are you sure you want to change the base?
Conversation
|
Documentation preview for this PR (built with commit 4e7490d; changes) is ready! 🎉 |
|
|
||
| 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: |
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.
the else could be removed
| if n == 1: | ||
| return infinity | ||
| elif n == 0: | ||
| if n == 0: |
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.
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: |
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.
do we really need to check n >= 1 ? we have already tested whether n <= 0.
dcoudert
left a comment
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.
LGTM.
just reading the code there and cleaning a little bit
📝 Checklist