On Wed, Sep 10, 2014 at 8:09 AM, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote: > On 2014-09-10 15:06, Christophe Bal wrote: >> >> Hello. >> >> I would to do two thinks. >> >> 1. Know the number of decimal digits that Sage uses in a program. >> 2. Choose the number of decimal digits displayed. > > > I believe the recommended way to choose the precision is to do: > > RR = RealField(1000) # 1000 bits of precision > > Then do all your computations in RR by converting your input to RR: > > a = RR(1/3) > b = RR(pi) > > When you now compute a+b, it will be computed to 1000 digits of precision.
Yep, you have to explicitly control the number of digits. There is no notion of setting some sort of implicit global default. Incidentally, I would recommend doing R = RealField(1000) instead of RR = RealField(1000), since RR is pre-defined to be RealField(53), and overwriting that might cause confusion. One other thing -- if you type in a decimal literal, the precision will depend on the number of digits you typed. -- William > > > -- > 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 sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org wst...@uw.edu -- 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.