hi, I'm really surprised about the consideration for a remark like a newbie like me. Of course computational precision is important, the little game i was showing leads to a soluion around 0.00001 for ra and rb. So that brings us to part 2: convert to string; works for an isolated number, but not for mixtures of symbolic and numeric expressions I would think. Can the latex (or generic) output expression be parsed for pretty printing (his means find the numbers in the expression and put them through %f% ? thanks m
12 dec, 16:06, Jason Grout <jason-s...@creativetrax.com> wrote: > Simon King wrote: > > Hi Marc! > > > On 12 Dez., 15:48, Jason Grout <jason-s...@creativetrax.com> wrote: > >> marcW wrote: > > [...] > >> If you don't care about precision (i.e., all numbers are rounded off to > >> 2-3 digits), then you can declare your numbers this way: > > >> sage: R=RealField(15) > >> sage: R(pi) > > [...] > > > Or, if you *do* care about the precision in the computation, but don't > > want to see more then 3 digits in the final result, you may do > > sage: print 1.0 > > 1.00000000000000 > > sage: print '%.3f'%1.0 > > 1.000 > > Hmmm. Yeah, we probably ought to make this easier to just print the > first n digits after the decimal by default for RR numbers, or to not > print out the trailing zeros. I can't imagine telling my students, for > example, that they need to do '%.3f'%num every time they come across a > number, especially since they just want to display the equation, not > format it as a string. > > What do people think about this interface? > > sage: RR.print_digits=3 > sage: 3.09384 > 3.094 > sage: RR.print_trailing_zeros=False > sage: RR.print_digits=None > sage: 3.09384 > 3.09384 > > Make it something like the RR.scientific_notation flag that is currently > in use. > > Thanks, > > Jason > > -- > Jason Grout -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org