Opened 9 years ago
Closed 8 years ago
#14955 closed defect (fixed)
HeilbronnMerel(50000) raises a RuntimeError
Reported by: | tian | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-6.2 |
Component: | modular forms | Keywords: | sd51 |
Cc: | Merged in: | ||
Authors: | Peter Bruin | Reviewers: | Alex Ghitza |
Report Upstream: | N/A | Work issues: | |
Branch: | 8fde195 (Commits, GitHub, GitLab) | Commit: | 8fde195d7610e81dbba78fe5c062652a02b780f7 |
Dependencies: | Stopgaps: |
Description
sage: H=HeilbronnMerel(50000) -------------------------------------------------------------------- RuntimeError Traceback (most recent call last) /home/guests/sage-5.4.1/<ipython console=""> in <module>() /home/guests/sage-5.4.1/local/lib/python2.7/site-packages/sage/modular/modsym/heilbronn.so in sage.modular.modsym.heilbronn.HeilbronnMerel.__init__ (sage/modular/modsym/heilbronn.c:5185)() /home/guests/sage-5.4.1/local/lib/python2.7/site-packages/sage/modular/modsym/heilbronn.so in sage.modular.modsym.heilbronn.HeilbronnMerel._initialize_list (sage/modular/modsym/heilbronn.c:5343)() RuntimeError: Floating point exception
Change History (7)
comment:1 follow-up: ↓ 3 Changed 8 years ago by
comment:2 Changed 8 years ago by
- Keywords sd51 added
comment:3 in reply to: ↑ 1 Changed 8 years ago by
Replying to AlexGhitza:
For the record,
HeilbronnMerel(46342)
seems to be the earliest point of failure.
This looks like an integer overflow. The method HeilbronnMerel._initialize_list()
sets bc = a*d - n
, where a
and d
are <= n
, and bc
is an int
.
sage: n = 46342 sage: n^2 - n < 2^31 False sage: (n-1)^2 - (n-1) < 2^31 True
I guess making bc
a long long
will solve this.
comment:4 Changed 8 years ago by
- Branch set to u/pbruin/14955-HeilbronnMerel_overflow
- Commit set to 8fde195d7610e81dbba78fe5c062652a02b780f7
- Status changed from new to needs_review
Indeed it does. (Note about the patch: llong
is defined as long long
earlier in the file.) I have tested this, but have not added any doctests, since any example would take much longer than the longest currently existing doctests.
comment:5 Changed 8 years ago by
Looks good to me. For the record, under sage-6.2.beta8 running on sage.math, HeilbronnMerel(46342)
finishes (successfully) in about 5 minutes, and HeilbronnMerel(50000)
in about 6 minutes.
comment:6 Changed 8 years ago by
- Milestone set to sage-6.2
- Reviewers set to Alex Ghitza
- Status changed from needs_review to positive_review
comment:7 Changed 8 years ago by
- Branch changed from u/pbruin/14955-HeilbronnMerel_overflow to 8fde195d7610e81dbba78fe5c062652a02b780f7
- Resolution set to fixed
- Status changed from positive_review to closed
For the record,
HeilbronnMerel(46342)
seems to be the earliest point of failure.