On Tuesday, October 7, 2014 1:33:19 PM UTC-7, Jeroen Demeyer wrote: > > > > The ramifications for coercion discovery are also quite big: > No, you're understanding it wrong. The parent of the result of any > computation would be the same as now. The result of adding 2 RealNumbers > with differing precision would still be a RealNumber of the lowest > precision. > read the example again:
sage: A = RealField(50) sage: B = RealField(100) sage: R.<x> = A[] sage: a = A(-1) sage: c = R(a) sage: b = B(1+2^-80) sage: a + b # with your change this would have higher precision sage: c + b # with your change this addition would happen in R and hence with the precision of A. when c and b get added, there is no "compatible" parent immediately visible here. You just have elements from B and R (a polynomial ring) and B is coercible into R because it is coercible into the base ring of R. The default action is to coerce b into R (by making it a constant polynomial, with its coefficient in A). THEN the addition happens, with the reduced accuracy in the result. Intercepting this would be a lot of work. -- 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.