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

coherent output type for polynomial.degree() #25182

Closed
videlec opened this issue Apr 16, 2018 · 11 comments
Closed

coherent output type for polynomial.degree() #25182

videlec opened this issue Apr 16, 2018 · 11 comments

Comments

@videlec
Copy link
Contributor

videlec commented Apr 16, 2018

Some methods expect a Sage integer from the degree method but this is not consistent accross sage polynomials

sage: R1 = PolynomialRing(Zmod(3), 'x', implementation='NTL')
sage: type(R1.an_element().degree())
<type 'int'>
sage: R2 = PolynomialRing(Zmod(3), 'x', implementation='FLINT')
sage: type(R2.an_element().degree())
<type 'sage.rings.integer.Integer'>

As a consequence

sage: GF(next_prime(2^63)^6)
Traceback (most recent call last):
...
AttributeError: 'int' object has no attribute 'divisors'

Initial report on sage-support.

CC: @JohnCremona

Component: algebra

Author: Vincent Delecroix

Branch/Commit: c485d4c

Reviewer: Frédéric Chapoton, John Cremona

Issue created by migration from https://trac.sagemath.org/ticket/25182

@videlec videlec added this to the sage-8.2 milestone Apr 16, 2018
@videlec
Copy link
Contributor Author

videlec commented Apr 16, 2018

Commit: 76561b7

@videlec
Copy link
Contributor Author

videlec commented Apr 16, 2018

Branch: u/vdelecroix/25182

@videlec
Copy link
Contributor Author

videlec commented Apr 16, 2018

New commits:

76561b7fix output type of degree method of polynomials

@JohnCremona
Copy link
Member

comment:2

Looks good to me. Positive review if the patchbots go green!

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 16, 2018

Changed commit from 76561b7 to c485d4c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 16, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

c485d4cdocfix

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:4

Let it be.

@fchapoton
Copy link
Contributor

Changed reviewer from Frédéric Chapoton to Frédéric Chapoton, John Cremona

@videlec
Copy link
Contributor Author

videlec commented Apr 17, 2018

comment:6

Merci :-)

@vbraun
Copy link
Member

vbraun commented May 14, 2018

Changed branch from u/vdelecroix/25182 to c485d4c

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

No branches or pull requests

4 participants