ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 14 Nov 2017 11:14:12 +0100Can you help me with digits of pi?https://ask.sagemath.org/question/39517/can-you-help-me-with-digits-of-pi/ I want to put the first n digits of pi into a list. I have tried numerical approximation but I was not able to figure out if it could help me .Neither did I find a function for it.Mon, 13 Nov 2017 20:22:11 +0100https://ask.sagemath.org/question/39517/can-you-help-me-with-digits-of-pi/Answer by vdelecroix for <p>I want to put the first n digits of pi into a list. I have tried numerical approximation but I was not able to figure out if it could help me .Neither did I find a function for it.</p>
https://ask.sagemath.org/question/39517/can-you-help-me-with-digits-of-pi/?answer=39533#post-id-39533At least there is the following workaround
sage: map(ZZ, pi.n(digits=20).str()[2:])
[1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 8, 4, 6, 2, 0]
If you want more digits, just increase `20` to something else.Tue, 14 Nov 2017 11:14:12 +0100https://ask.sagemath.org/question/39517/can-you-help-me-with-digits-of-pi/?answer=39533#post-id-39533