Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

On my main machine :

sage: from tempfile import TemporaryFile
....: from time import time as stime
....: Ndig=13048009
....: foo=str(frac(pi).n(digits=Ndig))
....: f=TemporaryFile(mode="w+", encoding="utf8")
....: f.write("%s\n"%foo[2:])
....: f.seek(0)
....: bar=f.readline()
....: f.close()
....: t1=stime()
....: gee=eval("Integer(%s)"%bar)
....: t2=stime()
....: print("Reading an integer ", ceil(gee.log(10)), "digits long took ",round(
....: t2-t1, 2)," seconds")
13048010
0
Reading an integer  13048009 digits long took  33.85  seconds

Even if my machine is indeed speedy (Ryzen 9 4+Ghz), this shows that reading your integer should be a matter of a few minutes at most.

Checking your code might be a good idea...

HTH,