On Jun 22, 2009, at 6:01 AM, kcrisman wrote: >>> I want that >>> show(function) would give me just 1 precision digit after comma >>> how could I achieve this? >> >> You can use Python's string formatting:http://docs.python.org/ >> library/stdtypes.html#string-formatting >> >> To get floating-point numbers to display with one decimal point, do >> something like this: >> >> sage: '%.2f' % pi >> '3.14' >> sage: '%.1f' % pi >> '3.1' >> sage: '%.6f' % pi >> '3.141593' >> >> See the Python documentation I linked to above for more details. >> >> Dan > > It should be pointed out that for a while, maybe a couple releases at > some point this past fall, something related to the OP's question was > the default behavior - that is, floats only showed up to their last > non-zero digit. I think it was a patch from robertwb, but I'm not > sure, and in any case it no longer is the case. Does anybody know > what happened to that? I would really like that back, at least in > things like interacts, but even if it was jettisoned for good reasons, > it would be nice to know what happened.
Pre-pynac, all floating point numbers that were part of a symbolic expression were 53-bit. Now that they can be arbitrary precision (they are in fact wrapped Sage RealNumbers) the number of digits printed gives an indication of how many digits of precision are known. - Robert --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---