def u64_wpow
bend-collections-laws-math@1.0.0.0 · src/math/fixed.bend:354
import bend-collections-laws-math@1.0.0.0/src/math/fixed.bend as Fixed
import Base
import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as W
import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as X
import bend-collections-laws-math@1.0.0.0/src/math/instances.bend as I
354def u64_wpow(fuel: Nat, +e: U32, +b: W.U64, +acc: W.U64, z: Bool) -> W.U64:
355 match fuel z:
356 case 0n _:
357 acc
358 case 1n+f True{}:
359 acc
360 case 1n+ +f False{}:
361 u64_wpow(f, U32.shr(e), X.mul(b, b), pick(W.U64, I.u32_odd(e), X.mul(acc, b), acc), U32.is_zero(U32.shr(e)))