On May 6, 6:35 pm, Carl Witty <carl.wi...@gmail.com> wrote:
> On Wed, May 6, 2009 at 2:20 AM, Yann <yannlaiglecha...@gmail.com> wrote:
>
> > Just for the record,
> > isn't the following a bug?
>
> > sage: p=RealIntervalField(4)(3.1)
> > sage: p.str(style='brackets')
> > '[3.00 .. 3.25]'
> > sage: p
> > 4.?
>
> It's a deliberate design decision.  To quote from real_mpfi.pyx:
>
>         When there are two
>         possible results of equal precision and with the same error width,
>         then we pick the one which is farther from zero. (For instance,
>         RIF(0, 123) with two error digits could print as 61.?62 or 62.?62.
>         We prefer the latter because it makes it clear that the interval is
>         known not to be negative.)

I do agree

> In other words,
> sage: RealIntervalField(4)(0, 1)
> 1.?
> prints as the interval [0 .. 2], rather than [-1 .. 1], because IMHO
> it is useful to be able to know that an interval is nonnegative; and
> we do this by always picking the result farther from zero whenever
> there are two possible "correct" printings.  (Note that 3.? and 4.?
> would both include the interval [3.00 .. 3.25], so they are both
> correct in that sense.)

I would agree if it was 4.?1 (even I find something like 4.?±1 easier
to understand)
but without the error explicitely written, I would prefer to do what
is in the docstring:
   " In question style (the default), we print the "known correct"
part of the number "
My understanding of this sentence is that we print the digits known
for sure. And if a
number is in the interval [3.00 .. 3.25], this should be 3.?
The design you decision si only relevant IMHO if the error digits are
explicitely written

> It would be possible to use a different rule for choosing between two
> correct answers, but I like the current one.
>
> Carl
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to