#8157 closed defect (fixed)
why the bit limit of 2^24 in RealField?
Reported by: | zimmerma | Owned by: | AlexGhitza |
---|---|---|---|
Priority: | major | Milestone: | sage-4.3.4 |
Component: | basic arithmetic | Keywords: | |
Cc: | Merged in: | sage-4.3.4.alpha0 | |
Authors: | François Maltey, Paul Zimmermann | Reviewers: | Alex Ghitza |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
sage: R = RealField(16777217) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /users/caramel/zimmerma/.sage/temp/patate.loria.fr/31828/_users_caramel_zimmerm\ a__sage_init_sage_0.py in <module>() /usr/local/sage-core2/local/lib/python2.6/site-packages/sage/rings/real_mpfr.so\ in sage.rings.real_mpfr.RealField_constructor (sage/rings/real_mpfr.c:3723)() /usr/local/sage-core2/local/lib/python2.6/site-packages/sage/rings/real_mpfr.so\ in sage.rings.real_mpfr.RealField.__init__ (sage/rings/real_mpfr.c:3945)() ValueError: prec (=16777217) must be >= 2 and <= 16777216.
Note that 2^24 bits is only slightly above 5M digits, which is quite small (Fabrice Bellard recently computed 2700 billions of digits of Pi on a personal desktop, i.e., about 500,000 times more).
Attachments (2)
Change History (7)
Changed 12 years ago by
comment:1 Changed 12 years ago by
- Status changed from new to needs_review
comment:2 Changed 12 years ago by
- Description modified (diff)
comment:3 Changed 12 years ago by
- Reviewers set to Alex Ghitza
- Status changed from needs_review to positive_review
Looks good and passes tests.
The referee patch adds a couple of doctests (bug fixes should be accompanied by doctests so that we don't regress again). The slightly weird "OverflowError?: ..." in the second test is due to the fact that the error messages are slightly different on 32-bit than on 64-bit machines.
comment:4 Changed 12 years ago by
- Merged in set to sage-4.3.4.alpha0
- Resolution set to fixed
- Status changed from positive_review to closed
Merged in this order:
Paul: I merged trac_8157.patch, putting the ticket number in the commit message.
Note: See
TracTickets for help on using
tickets.
The attached patch solves this problem, for example: