Opened 9 years ago
Closed 9 years ago
#11952 closed defect (fixed)
Fix conversion Python -> PARI
Reported by: | jdemeyer | Owned by: | was |
---|---|---|---|
Priority: | major | Milestone: | sage-4.8 |
Component: | interfaces | Keywords: | |
Cc: | Merged in: | sage-4.8.alpha2 | |
Authors: | Jeroen Demeyer | Reviewers: | Robert Bradshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #11130, #11321, #11854, #11891, #11890, #11836 | Stopgaps: |
Description (last modified by )
Conversion of a Python complex
to PARI fails:
sage: pari(complex(I)) *** Warning: unused characters: j. 1
Moreover, the conversion of other Python types to PARI can be improved by adding special code instead of using strings. This also makes the conversion more precise, see the example below:
Without patch:
sage: f = float(4651990089563211/4503599627370496) sage: f 1.0329493015522242 sage: pari(f) 1.03294930155000
With patch:
sage: f = float(4651990089563211/4503599627370496) sage: f 1.0329493015522242 sage: pari(f) 1.03294930155222
Attachments (1)
Change History (16)
comment:1 Changed 9 years ago by
- Dependencies changed from #11130 to #11130, #11854
- Status changed from new to needs_review
comment:2 Changed 9 years ago by
- Dependencies changed from #11130, #11854 to #11130, #11854, #11904
comment:3 Changed 9 years ago by
- Dependencies changed from #11130, #11854, #11904 to #11130, #11854, #11891, #11890, #11904
comment:4 Changed 9 years ago by
- Dependencies changed from #11130, #11854, #11891, #11890, #11904 to #11130, #11321, #11854, #11891, #11890, #11904
comment:5 Changed 9 years ago by
- Dependencies changed from #11130, #11321, #11854, #11891, #11890, #11904 to #11130, #11321, #11854, #11891, #11890, #11836, #11904
comment:6 Changed 9 years ago by
- Status changed from needs_review to needs_work
comment:7 Changed 9 years ago by
- Description modified (diff)
comment:8 Changed 9 years ago by
- Status changed from needs_work to needs_review
comment:9 Changed 9 years ago by
- Status changed from needs_review to needs_work
Conversion from int
can be done without MPIR.
comment:10 Changed 9 years ago by
- Status changed from needs_work to needs_review
comment:12 Changed 9 years ago by
- Dependencies changed from #11130, #11321, #11854, #11891, #11890, #11836, #11904 to #11130, #11321, #11854, #11891, #11890, #11836
- Milestone set to sage-4.8
comment:13 follow-up: ↓ 14 Changed 9 years ago by
- Status changed from needs_review to positive_review
Looks good to me (pending all doctests passing) and much cleaner. I checked the derivatives in lseries_ell.py to higher precision, the new values are correct.
Nit:
if PyBool_Check(s): return self.PARI_ONE if s else self.PARI_ZERO
Changed 9 years ago by
comment:14 in reply to: ↑ 13 Changed 9 years ago by
- Reviewers set to Robert Bradshaw
Replying to robertwb:
if PyBool_Check(s): return self.PARI_ONE if s else self.PARI_ZERO
I made this small change.
comment:15 Changed 9 years ago by
- Merged in set to sage-4.8.alpha2
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Doctest failures in
lseries_ell.py
: