Opened 7 years ago

Closed 7 years ago

#12625 closed defect (fixed)

Conversion of pari elements to Sage fails on some negative valuation elements

Reported by: roed Owned by: roed
Priority: major Milestone: sage-5.0
Component: padics Keywords:
Cc: Merged in: sage-5.0.beta8
Authors: David Roe Reviewers: Xavier Caruso
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage: K = Qp(11,5)
sage: pari(K(11^-5)).sage()
ArithmeticError
sage: ZZ(pari(Qp(11)(11^-7)))
SEGFAULT

Attachments (2)

12625.patch (3.6 KB) - added by roed 7 years ago.
trac_12625-review.patch (1.3 KB) - added by was 7 years ago.
apply after the other patch

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by roed

comment:1 Changed 7 years ago by roed

  • Status changed from new to needs_review

comment:2 Changed 7 years ago by caruso

  • Reviewers set to Xavier Caruso
  • Status changed from needs_review to needs_work

I propose to modify the function padicprec() so that it computes itself the underlying prime number. Currently, one have:

sage: K = Qp(11,5)
sage: x = K(5)
sage: x
5 + O(11^5)
sage: y = pari(x)
sage: y.padicprec(11)
5
sage: y.padicprec(17)
  ***   not the same prime in padicprec.
  ***   Error in the PARI system. End of program.

Changed 7 years ago by was

apply after the other patch

comment:3 Changed 7 years ago by was

  • Status changed from needs_work to needs_review

I'm happy with this, but due to the amount I added, somebody else (anybody!) should sign off on it.

comment:4 Changed 7 years ago by roed

  • Status changed from needs_review to positive_review

Yep. That looks good.

comment:5 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.0.beta8
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.