1 | | {{{ |

2 | | sage: p=7 |

3 | | sage: k=GF(p) |

4 | | sage: k(2)^k(p) |

5 | | 1 |

6 | | sage: (GF(7)(2))^(GF(5)(2)) |

7 | | 4 |

8 | | sage: k(2)^p |

9 | | 2 |

10 | | }}} |

11 | | 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): |

12 | | {{{ |

13 | | sage: k.<a>=GF(p^2) |

14 | | sage: k(2)^k(p) |

15 | | 1 |

16 | | sage: k(2)^k(a) |

17 | | TypeError: not in prime subfield |

18 | | sage: ZZ(k(1)) |

19 | | 1 |

20 | | sage: ZZ(k(a)) |

21 | | TypeError: not in prime subfield |

22 | | }}} |

23 | | There is one side-effect of this that does look elegant: |

24 | | {{{ |

25 | | sage: R=Integers(p-1) |

26 | | sage: (k(2))^(R(p)) |

27 | | 2 |

28 | | }}} |

29 | | but in general I'd say an error should result from exponentiations like this. |

| 1 | Duplicate of #15709. |