def redc

bend-collections@1.0.0.0 · src/math/w64.bend:602

import bend-collections@1.0.0.0/src/math/w64.bend as W64
import Base
import bend-collections@1.0.0.0/src/math/u64.bend as W

602# t / 2^64 mod m for t = (tl, th) < m^2
603def redc(+m: W.U64, +mp: W.U64, t: W.U64 & W.U64) -> W.U64:
604  (+tl, +th) = t
605  redc_p(m, tl, th, mul128(mul(tl, mp), m))

Uses (6)

Used by (1)