On 2016-10-22 10:37, Ralf Stephan wrote:
|
sage:2*(QQbar(1))
2
sage:2^(QQbar(1))
...
TypeError:nocanonical coercion fromAlgebraicFieldto RationalField
|

Why does the one work, the other not?

Multiplication uses coercion.

Exponentiation does not use coercion, since that's usually not what you want (Mod(3,5)^7 should not become Mod(3,5)^Mod(2,5)).

If I'm not mistaken, only exponentiation and bitwise operators do not use coercion for arithmetic (and the latter probably should use coercion).


--
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to