Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #2567: import MPFR_PREC_MAX from mpfr.h instead of hard coding i…
…t to the 32 bit limit The discussion below is besides the point. The main issue is that we define MPFR_PREC_MAX in Sage's sources instead of pulling it in from mpfr.h. We do hard code the 32 bit value, so on 64 bit boxen we limit the user to much lower precision than is actually technically feasible as pointed out below. Cheers, Michael {{{ > > CODE: > > > s = pi.str(3000000*log(10,2)) > > o = open('/Users/ericahls/Desktop/file.txt','w') > > o.write(str(s)) > > o.close() > > > --- Trying to get out to the farthest decimal point of PI I can. > > > Error message: > > > Traceback (most recent call last): o.write(str(s)) > > File "/Applications/sage/local/lib/python2.5/site-packages/sage/ > > functions/functions.py", line 140, in str > > raise ValueError, "Number of bits must be at most 2^23." > > ValueError: Number of bits must be at most 2^23. > > > ----If i Put 2000000 instead 0f 3000000 the equation works. much over > > 2 million the equation breaks dwon. > > I think that 2^23 is a bound in mpfr, and Sage uses mpfr to > compute digits of pi. I don't know if one can compute more than > about 2^23 digits using mpfr. > > William Yes we can. The issue was that MPFR used the stack instead of the heap for certain operations [even when told not to use alloca] and would smash it therefore with large number of digits. That has been fixed in MPFR 2.3.1 (which we include) and all we need to do is to raise or remove the limit in our code and do some testing. Care to open a ticket? -- Mabshoff }}} URL: https://trac.sagemath.org/2567 Reported by: was Ticket author(s): Mike Hansen, Frédéric Chapoton Reviewer(s): Paul Zimmermann, François Bissey
- Loading branch information
Showing
2 changed files
with
28 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters