Opened 4 years ago
Closed 4 years ago
#21186 closed defect (fixed)
Fix overflow error in conversion to PARI finite field element
Reported by: | pbruin | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.4 |
Component: | interfaces | Keywords: | pari finite field |
Cc: | Merged in: | ||
Authors: | Peter Bruin | Reviewers: | Jeroen Demeyer |
Report Upstream: | N/A | Work issues: | |
Branch: | a02efbb (Commits) | Commit: | a02efbbb6112da7d0eec4c00806186a87f035137 |
Dependencies: | Stopgaps: |
Description
From John Jones on sage-devel:
p=13189065031705623239 Fq = FiniteField(p ** 3, "a") Fq_X = PolynomialRing(Fq, "x") pol=Fq_X("x^9 + 13189065031705622723*x^7 + 13189065031705622723*x^6 + 9288*x^5 + 18576*x^4 + 13189065031705590731*x^3 + 13189065031705497851*x^2 + 13189065031705497851*x + 13189065031705581443") pol.roots() Traceback (most recent call last): ... OverflowError: Python int too large to convert to C long
This arises because GEN
is by definition a (signed) long *
. It can be fixed by adding a function set_uel(GEN x, long n, ulong z)
to the PARI interface, implemented as uel(x, n) = z
in C (uel
is an existing PARI macro, similar to gel
).
Change History (8)
comment:1 Changed 4 years ago by
- Reviewers set to Jeroen Demeyer
comment:2 Changed 4 years ago by
- Branch set to u/pbruin/21186-pari_set_uel
- Commit set to a02efbbb6112da7d0eec4c00806186a87f035137
- Status changed from new to needs_review
comment:3 Changed 4 years ago by
- Status changed from needs_review to positive_review
comment:4 Changed 4 years ago by
comment:5 Changed 4 years ago by
- Status changed from positive_review to needs_work
comment:6 Changed 4 years ago by
It seems unlikely to be caused by this ticket. Are you merging any other PARI-related tickets?
comment:7 Changed 4 years ago by
- Status changed from needs_work to positive_review
comment:8 Changed 4 years ago by
- Branch changed from u/pbruin/21186-pari_set_uel to a02efbbb6112da7d0eec4c00806186a87f035137
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Fails on OSX, Linux 32-bit