This is correct:
sage: a = n(golden_ratio, digits=5000)
sage: len(str(a))
5001
This is not:
sage: a = n(golden_ratio, digits=5000000)
sage: len(str(a))
4999989
Any clue?
Jerome Tremblay
LaCIM, UQAM
misc/functional.py: prec = int((digits+1) * 3.32192) + 1
rings/complex_interval.pyx: bits =
max(int(3.32192*len(s_real)),int(3.32192*len(s_imag)))
rings/complex_number.pyx: bits =
max(int(3.32192*len(s_real)),int(3.32192*len(s_imag)))
rings/real_mpfi.pyx: bits = int(3.32192*len(s))
rings/real_mpfr.pyx: bits = int(3.32192*sigfigs)+1
symbolic/expression.pyx: prec = int((digits+1) * 3.32192) + 1
Doug
My first guess is that the problem might come from the fact that str
truncates the last few digits. However, even with that disabled,
there are still not enough digits:
sage: len(a.str(truncate=False))
4999992
(Only 3 more)
Somebody needs to open a ticket.
-- William