On 23 October 2016 at 08:05, Ralf Stephan <[email protected]> wrote: > On Saturday, October 22, 2016 at 6:28:58 PM UTC+2, vdelecroix wrote: >> >> ... The behavior of any operation in Sage is that >> the parent of op(a, b) should only depend on the operator op, >> parent(a) and parent(b). Powers are a bit special but not enough to >> use conversion instead of coercion. > > > Reference, please? This seems quite important but I cannot find > it in the developer manual.
http://doc.sagemath.org/html/en/reference/coercion/index.html But as Jeroen said, powers are not part of the coercion model since when you do pow(a, b) you do not want a and b to have the same parent in general. However the following situations involve coercions sage: 2 ** 3.4 10.5560632861832 sage: 2.3 ** 3 12.1670000000000 sage: R = RealField(256) sage: R(1) ** 2.3 1.000000000000000000000000000000000000000000000000000000000000000000000000000 sage: 1 ** R(2.3) 1.000000000000000000000000000000000000000000000000000000000000000000000000000 In general, pow(a, b) should only depend on parent(a) and parent(b) and not the actual values of a and b. This is how behave all arithmetic operations. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
