ZZ and QQ live in their own worlds (sigh).

sage: ZZ(8)^(1/3)
2
sage: ZZ(-8)^(1/3)
2*(-1)^(1/3)
sage: ZZ(1)^(1/3)
1
sage: ZZ(-1)^(1/3)
(-1)^(1/3)
sage: QQ(8)^(1/3)
2
sage: QQ(-8)^(1/3)
2*(-1)^(1/3)
sage: QQ(1)^(1/3)
1
sage: QQ(-1)^(1/3)
(-1)^(1/3) 
 

>>> RR(ZZ(-8)^(1/3)) 
... 
TypeError: unable to convert '1.00000000000000+1.73205080756888*I' 
to a real number


This shows that symbolic expression (-1)^(1/3) is understood as the complex 
principal root. Then AA((-1)^(1/3)) should raise an error. Currently 

sage: AA((-1)^(1/3))
-1

In the happy world, we should understand that (-1)^(1/3) gets on different 
values depending on the target parent.  

This coercion also seems questionable: 

>>> parent(ZZ(8)^(1/3)) 
Rational Field


Indeed, weird.

exponentiation should not use a general coercion and the type of the 
exponent should be treated differently from the type of the base.


I agree.

-- 
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/8420164b-051a-47a7-9e0e-969879c81336n%40googlegroups.com.

Reply via email to