#11797: Finite field elements are allowed in exponents
--------------------------------+-------------------------------------------
Reporter: nbruin | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.7.2
Component: basic arithmetic | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
--------------------------------+-------------------------------------------
{{{
sage: p=7
sage: k=GF(p)
sage: k(2)^k(p)
1
sage: (GF(7)(2))^(GF(5)(2))
4
sage: k(2)^p
2
}}}
It looks like it's simply quietly lifting the exponent to the integers,
which it shouldn't do because there is no coercion in that direction (only
a conversion):
{{{
sage: k.<a>=GF(p^2)
sage: k(2)^k(p)
1
sage: k(2)^k(a)
TypeError: not in prime subfield
sage: ZZ(k(1))
1
sage: ZZ(k(a))
TypeError: not in prime subfield
}}}
There is one side-effect of this that does look elegant:
{{{
sage: R=Integers(p-1)
sage: (k(2))^(R(p))
2
}}}
but in general I'd say an error should result from exponentiations like
this.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11797>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.