On 8/6/13 7:07 AM, Daniel Krenn wrote:
Hi,

I have the following:

   sage: RIF(1.332,1.334), RIF(1.332,1.334).str(style='brackets')
   (1.34?, '[1.3320000000000000 .. 1.3340000000000001]')

This is not wrong, since the questionmark means +/-1 on the previous
digit. But why is the resulting string not 1.33?, which would be more
"natural" to me? Is there a reason for doing so?

I think the default is to pick a 'center' point that is furthest from zero, all else being equal. This makes it clearer when an interval is all one sign. See the documentation here:

https://github.com/sagemath/sage/blob/master/src/sage/rings/real_mpfi.pyx#L1569

"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.)"


Thanks,

Jason


--
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/groups/opt_out.


Reply via email to