On Mon, Jul 13, 2015 at 10:15 AM, Simon King <simon.k...@uni-jena.de> wrote: > Hi! > > On 2015-07-13, Nathann Cohen <nathann.co...@gmail.com> wrote: >> sage: sqrt(2) # a symbolic ring element >> sqrt(2) >> sage: QQbar(sqrt(2)) # an algebraic value >> 1.414213562373095? >> >> It is true that this final '?' sounds more like a '...', as if some >> additional >> digits were hidden in a value stored as a float/double. Yet it is exact. >> >> How could we replace it? Ideally, that would be a 'sqrt(2)' but can we always >> provide such a representation cheaply? Could we display it as 'sqrt(2)' at >> least >> when it is free to do so? > > The elements of QQbar are the solutions of algebraic equations. As you > probably know, the solutions of algebraic equations of degree > 4 can, in > general, not be expressed that nicely. But it seems like an appealing > idea to show a nice expression for algebraic numbers of degree up to 4. > >> If we cannot get rid totally of this numerical representation, what would you >> think of replacing this '?' by a 'alg', which would be (slightly) more >> informative, e.g.: > > 1.4142134... looks exact to me: "..." seems to suggest that Sage knows all > (potentially infinitely many) digits but can't show them all, whereas "?" > seems > to suggest that the last shown digit is questionable (i.e., subject to > rounding > errors), i.e., "?" seems to suggest that Sage doesn't know the exact value.
Yes. Also, with interval arithmetic, that is precisely what it means: sage: RealIntervalField(53)(sqrt(2)) 1.414213562373095? sage: QQbar(sqrt(2)) 1.414213562373095? It's certainly not good that the above two print in the same way. The (mysterious [1]) person who made those design choices -- Carl Witty -- isn't contributing anymore, or I'd ask his opinion. [1] http://stackoverflow.com/users/684532/carl-witty > > So, I'd prefer to display elements of QQbar as floating point numbers > (what default precision?), always rounded DOWN to the last digit that is > displayed, and followed by "..." (not "?") unless the displayed value is > exact. So, what is displayed is an initial part of the potentially > infinite sequence of digits. > > Best regards, > Simon > > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- William (http://wstein.org) -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.