On Tuesday 3 September 2024 at 09:08:06 UTC-7 Kwankyu Lee wrote:
That in Python one has non-real value for (-1)**(1/3) is two things: 1/3 is actually a float, and absence of typing. These are artifacts of the programming language, and make little sense mathematically. Do you mean that the value of (-1)**(1/3) is arbitrarily chosen, regardless of the mathematical value of (-1)^(1/3)? The thing is: in Python you cannot *ask* for (-1)^(1/3) because you don't get to pass in 1/3. The function evaluated here really is exp(log(x)*y), with x=-1 and y=6004799503160661/2^54 [where it's left to python to choose a branch for log(x) ] Because of the duck typing conventions in python, they also cannot really make a distinction between -1 the integer, -1 the real number and -1 the complex number. So they have to settle for one unifying definition. In sage we actually do have rational numbers that can be used for exponents. That's important because in Qbar and AA we can choose a result for raising things to a fractional power, but not for raising elements to a float/real power in general. We already have precedent for the parent being relevant for the result. For instance GF(5)(3)^(-1) and QQ(3)^(-1) (but GF(5)(1/3) does agree, so at least we have that) Incidentally, (GF(5)(-1))^(1/2) leads to an error. -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/4b7fed22-320b-4ee1-bd11-82b27b2af47dn%40googlegroups.com.