On Sep 9, 6:17 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
> That's how I understand it from the documentation. Wow, I really like
> your explanation. Would you care if we included that in the
> documentation? Are you comfortable submitting a patch to the documentation?
Not really, in view of my response to the next suggestion.
> On the other hand, how would you change the above design to be better?
> Maybe this could just be a patch making the code better, rather than a
> patch to the documentation.
Now you're talking.
If I understand you right, the notation 3.14? is a convenience and
nothing will break if it is changed. I suggest that it should mean
the half-open interval [3.14,3.15).
Advantages:
(a) No need for a tie-breaking rule.
(b) Half the length of [3.13,3.15].
(c) The displayed digits are guaranteed to be correct, in the sense
that any number in that interval starts out with them.
(d) Easy to explain to an idiot.
Extension to error digits: rather than having one pair of error digit
sequences giving the width of the interval of uncertainty in units
that require a bit of thought, give two pairs that actually specify
the possibilities.
I.e. for the Archimedes interval x=RIF(3+10/71,3+1/7) , it would be
nice to have
sage: x.str(error_digits=2)
3.14?08..29
In the GUI as opposed to the command line, the 08 could appear as a
subscript and the 29 as a superscript: $3.14_{08}^{29}$ in TeX
notation.
The fact that 08..29 is left-closed and right-open is very Pythonic
too.
Related: if I say "style='brackets'", error_digits is ignored. Why
not allow:
sage: x.str(error_digits=2,style="brackets")
[ 3.1408 .. 3.1429 ]
Two error digits might even be the default for brackets. After all,
if a number is correct to so few digits, who wants to see sixteen
decimals of it?
Dirk
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an 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
-~----------~----~----~----~------~----~------~--~---