Le 21/02/2016 20:40, John Cremona a écrit :
Try RealField(500).pi() and similar.

Yes, it works... but my small piece of code should also give correct results...
thanks.
t.

On 21 Feb 2016 18:10, "Thierry Dumont" <[email protected]
<mailto:[email protected]>> wrote:

    I have students who want to compute decimals of pi...so, what can we
    do with RealField(n) ?
    I make the following script (pi.sage):

    ------------------------
    for p in [2..10]:
         R=RealField(10^p)
         pii=4*atan(R(1))
         print p,R,pii
    ------------------------

    Then, using sage 7.0 or 7.1.beta4:

    attach("pi.sage")

    This produces a lot of seemingly correct output, but, as it takes a
    too long time to finish :-), I interrupt the computation (Ctrl-c).

    So, lets try again; replace 10 by 5 in the for statement (I do not
    leave sage). I get NaNs:


    2 Real Field with 100 bits of precision NaN
    3 Real Field with 1000 bits of precision NaN
    4 Real Field with 10000 bits of precision NaN
    5 Real Field with 100000 bits of precision NaN
    .....

    Strange.

    Yours
    t.d.


    --
    You received this message because you are subscribed to the Google
    Groups "sage-support" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected]
    <mailto:sage-support%[email protected]>.
    To post to this group, send email to [email protected]
    <mailto:[email protected]>.
    Visit this group at https://groups.google.com/group/sage-support.
    For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

<<attachment: tdumont.vcf>>

Reply via email to