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

Trac 12555 broke conversion of zero p-adics to PARI #15653

Closed
jdemeyer opened this issue Jan 9, 2014 · 6 comments
Closed

Trac 12555 broke conversion of zero p-adics to PARI #15653

jdemeyer opened this issue Jan 9, 2014 · 6 comments

Comments

@jdemeyer
Copy link

jdemeyer commented Jan 9, 2014

Zero p-adics should have precp=0, so this is wrong:

sage: ZpFM(3,10)(0)._pari_().debug()
[&=00000000040368d0] PADIC(lg=5):0e00000000000005 (precp=10,valp=0):0002a00000000000 00000000040368b8 00000000040368a0 0000000004036890 
    p : [&=00000000040368b8] INT(lg=3):0200000000000003 (+,lgefint=3):4000000000000003 0000000000000003 
  p^l : [&=00000000040368a0] INT(lg=3):0200000000000003 (+,lgefint=3):4000000000000003 000000000000e6a9 
    I : [&=0000000004036890] INT(lg=2):0200000000000002 (0,lgefint=2):0000000000000002 

This causes for example the following discriminant to be wrong:

sage: x = polygen(ZpFM(3,10))
sage: (x^3+x+1)._pari_().poldisc()
2 + 3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^10)
sage: (x^3+x+1).discriminant()
2 + 3 + 2*3^2 + 3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^10)

Blocker because this is a serious regression caused by #12555.

CC: @roed314

Component: padics

Author: Jeroen Demeyer

Branch/Commit: u/jdemeyer/ticket/15653 @ 7537427

Reviewer: David Roe

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

@jdemeyer jdemeyer added this to the sage-6.1 milestone Jan 9, 2014
@jdemeyer
Copy link
Author

jdemeyer commented Jan 9, 2014

Author: Jeroen Demeyer

@jdemeyer
Copy link
Author

jdemeyer commented Jan 9, 2014

Branch: u/jdemeyer/ticket/15653

@jdemeyer
Copy link
Author

jdemeyer commented Jan 9, 2014

New commits:

7537427Fix conversion of zero p-adics to PARI

@jdemeyer
Copy link
Author

jdemeyer commented Jan 9, 2014

Commit: 7537427

@roed314
Copy link
Contributor

roed314 commented Jan 9, 2014

Reviewer: David Roe

@roed314
Copy link
Contributor

roed314 commented Jan 9, 2014

comment:4

Good catch.

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

3 participants