def BigInt.pow
import bend-kit-bignum@0.1.0.0/bigint.bend as Bigintimport Base
427def BigInt.pow(b: BigInt, +e: Nat) -> BigInt:
428 match b:
429 case BigInt{s, x}:
430 BigInt.mk(Bool.and(s, Nat.is_eq(Nat.mod(e, 2n), 1n)),
431 Mag.pow(e, x, e, Con{1, Nil{}}))