From eae7a9a6932af6cfe16c0f29e7b5ef04b5f5913b Mon Sep 17 00:00:00 2001 From: Lorenz Panny Date: Sun, 10 Jul 2022 15:23:29 +0800 Subject: [PATCH] make pow(x,e,m) return an element with the same parent as x --- src/sage/rings/integer.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx index a4399439015..e6533d80016 100644 --- a/src/sage/rings/integer.pyx +++ b/src/sage/rings/integer.pyx @@ -2180,7 +2180,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement): """ if modulus is not None: from sage.rings.finite_rings.integer_mod import Mod - return Mod(left, modulus) ** right + return (Mod(left, modulus) ** right).lift() if type(left) is type(right): return (left)._pow_(right)