def jam_nat

bend-collections-laws-crypto@1.0.0.0 · src/math/f64.bend:600

import bend-collections-laws-crypto@1.0.0.0/src/math/f64.bend as F64
import Base

600# the jam of n >> d (the bits shifted out OR-ed into bit 0)
601def jam_nat(+d: Nat, +n: Nat) -> Nat:
602  Nat.add(Nat.mul(2n, Nat.div(high_bits(d, n), 2n)), Nat.max(Nat.mod(high_bits(d, n), 2n), Nat.min(low_bits(d, n), 1n)))

Uses (9)

Used by (1)