#18518: Fix Polynomial.denominator() for high-degree polynomials
-------------------------------------+-------------------------------------
Reporter: bruno | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.8
Component: commutative | Resolution:
algebra | Merged in:
Keywords: polynomial | Reviewers:
Authors: Bruno Grenet | Work issues:
Report Upstream: N/A | Commit:
Branch: | 74ae1f63ceb1b4934c9325c10aa48fbf70fbc081
u/bruno/denominator | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by bruno):
* status: new => needs_review
* commit: => 74ae1f63ceb1b4934c9325c10aa48fbf70fbc081
Old description:
> Currently, the method `Polynomial.denominator` does not work with very
> high-degree (sparse) polynomial:
> {{{
> sage: R.<x> = PolynomialRing(QQ, sparse=True)
> sage: p = x^(2^100) - 1/2
> sage: p.denominator()
> Traceback (most recent call last):
> ...
> OverflowError: cannot fit 'long' into an index-sized integer
> }}}
>
> This comes from the method using `self.list()` instead of
> `self.coefficients()`. I correct this and obtain:
>
> {{{
> sage: R.<x> = PolynomialRing(QQ, sparse=True)
> sage: p = x^(2^100) - 1/2
> sage: p.denominator()
> 2
> }}}
New description:
Currently, the method `Polynomial.denominator` does not work with very
high-degree (sparse) polynomial:
{{{#!python
sage: R.<x> = PolynomialRing(QQ, sparse=True)
sage: p = x^(2^100) - 1/2
sage: p.denominator()
Traceback (most recent call last):
...
OverflowError: cannot fit 'long' into an index-sized integer
}}}
This comes from the method using `self.list()` instead of
`self.coefficients()`. I correct this and obtain:
{{{#!python
sage: R.<x> = PolynomialRing(QQ, sparse=True)
sage: p = x^(2^100) - 1/2
sage: p.denominator()
2
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/18518#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.