convergents(x, n) returns n+1 convergents, not the documented first n
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with the Python binding for convergents(x, n) and compare its count handling with the documented behavior in the docstring. Reproduce the examples with rssn.Session().compute(...), then add or update tests covering positive counts and n = 0. The change is done when the function returns exactly the requested number of convergents, including an empty list for zero.
Written by the indexing model from the issue text.
Description
convergents(x, n) returns n + 1 convergents instead of the first n.
import rssn
s = rssn.Session()
s.compute("convergents(355/113, 1)").text # 'list(3, 22/7)' <- 2 values
s.compute("convergents(355/113, 2)").text # 'list(3, 22/7, 355/113)' <- 3 values
The docstring says "first n continued-fraction convergents p_k / q_k of x", so n = 1 should give list(3) and n = 2 should give list(3, 22/7).
Every call is off by one, which means the count argument cannot be used to request a specific prefix length — the usual reason to pass n at all. It also means convergents(x, 0) returns one convergent rather than an empty list, which is the natural reading of "first 0".
Expected: n values, i.e. list(3) for n = 1 and list(3, 22/7) for n = 2.
rssn 0.3.0, Python binding, Windows x86_64.
- Dominant language
- Rust
- Stars
- 36
- Forks
- 3
- Avg merge
- 18h 51m
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Apich-Organization/rssn
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Apich-Organization/rssn#295 ·
Maintainers usually reply within 1 day
-
area/algebra good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Apich-Organization/rssn#293 ·
Maintainers usually reply within 1 day
-
area/linear-algebra good first issue help wanted kind/wrong-result severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Apich-Organization/rssn#277 ·
Maintainers usually reply within 1 day
-
area/linear-algebra good first issue help wanted kind/doc-mismatch severity/5-trivial
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Apich-Organization/rssn#276 ·
Maintainers usually reply within 1 day
-
area/statistics help wanted kind/wrong-result severity/2-critical
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Apich-Organization/rssn#263 ·
Maintainers usually reply within 1 day
All issues in Apich-Organization/rssn
Similar issues
-
Android bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anefzaoui/misterdownloadmanager#2516 ·
Maintainers usually reply within 1 day
-
editor ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
state:triage tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 89/100
agent8-cash/ethpayserver#731 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day