Skip to content

Conversion from formal series to power/LaurentSeriesRing silently truncate negative term #39839

Open
@user202729

Description

@user202729

Steps To Reproduce

sage: var("x")
....: f = (1/x+sqrt(x+1)).series(x)
x
sage: f
1*x^(-1) + 1 + 1/2*x + (-1/8)*x^2 + 1/16*x^3 + (-5/128)*x^4 + 7/256*x^5 + (-21/1024)*x^6 + 33/2048*x^7 + (-429/32768)*x^8 + 715/65536*x^9 + (-2431/262144)*x^10 + 4199/524288*x^11 + (-29393/4194304)*x^12 + 52003/8388608*x^13 + (-185725/33554432)*x^14 + 334305/67108864*x^15 + (-9694845/2147483648)*x^16 + 17678835/4294967296*x^17 + (-64822395/17179869184)*x^18 + 119409675/34359738368*x^19 + Order(x^20)
sage: PowerSeriesRing(QQ, "x")(f)
1 + 1/2*x - 1/8*x^2 + 1/16*x^3 - 5/128*x^4 + 7/256*x^5 - 21/1024*x^6 + 33/2048*x^7 - 429/32768*x^8 + 715/65536*x^9 - 2431/262144*x^10 + 4199/524288*x^11 - 29393/4194304*x^12 + 52003/8388608*x^13 - 185725/33554432*x^14 + 334305/67108864*x^15 - 9694845/2147483648*x^16 + 17678835/4294967296*x^17 - 64822395/17179869184*x^18 + 119409675/34359738368*x^19 + O(x^20)
sage: LaurentSeriesRing(QQ, "x")(f)
1 + 1/2*x - 1/8*x^2 + 1/16*x^3 - 5/128*x^4 + 7/256*x^5 - 21/1024*x^6 + 33/2048*x^7 - 429/32768*x^8 + 715/65536*x^9 - 2431/262144*x^10 + 4199/524288*x^11 - 29393/4194304*x^12 + 52003/8388608*x^13 - 185725/33554432*x^14 + 334305/67108864*x^15 - 9694845/2147483648*x^16 + 17678835/4294967296*x^17 - 64822395/17179869184*x^18 + 119409675/34359738368*x^19 + O(x^20)

Expected Behavior

The conversion to PowerSeriesRing ought to raise an error, be and the conversion to LaurentSeriesRing ought to keep the 1*x^(-1) term.

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions