Skip to content
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

truncate_neg() fails on LaurentSeriesRing(QQ) when valuation is positive #39710

Open
user202729 opened this issue Mar 15, 2025 · 3 comments · May be fixed by #39711
Open

truncate_neg() fails on LaurentSeriesRing(QQ) when valuation is positive #39710

user202729 opened this issue Mar 15, 2025 · 3 comments · May be fixed by #39711

Comments

@user202729
Copy link
Contributor

sage: S.<t> = LaurentSeriesRing(QQ)
sage: (t^-2+t^-1+1+t+t^2).truncate_neg(-1)
t^-1 + 1 + t + t^2
sage: (t^-2+t^-1+1+t+t^2).truncate_neg(1)
t + t^2
sage: (t+t^2).truncate_neg(-1)
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
Cell In[40], line 1
----> 1 (t+t**Integer(2)).truncate_neg(-Integer(1))

File laurent_series_ring_element.pyx:1085, in sage.rings.laurent_series_ring_element.LaurentSeries.t
runcate_neg()

File power_series_poly.pyx:614, in sage.rings.power_series_poly.PowerSeries_poly.__rshift__()

File polynomial_rational_flint.pyx:827, in sage.rings.polynomial.polynomial_rational_flint.Polynomia
l_rational_flint.__rshift__()

OverflowError: can't convert negative value to unsigned long


sage: (t+t^2).truncate_neg(1)
t + t^2
@user202729 user202729 linked a pull request Mar 15, 2025 that will close this issue
5 tasks
@tscrim
Copy link
Collaborator

tscrim commented Mar 17, 2025

The problem is that truncate_neg is starting from a point less than the valuation (in which case, it should just return the original series).

@5iri
Copy link

5iri commented Mar 17, 2025

Hi!

What exactly is left to be done here?

@tscrim
Copy link
Collaborator

tscrim commented Mar 17, 2025

The optimization noted in #39711.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants