def BigInt.pow

bend-kit-bignum@0.1.0.0 · bigint.bend:427

import bend-kit-bignum@0.1.0.0/bigint.bend as Bigint
import 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{}}))

Uses (8)

Used by (1)