def pack_n

bend-collections-laws-crypto@1.0.0.0 · spec/math/f64.bend:164

import bend-collections-laws-crypto@1.0.0.0/spec/math/f64.bend as F64
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as C
import bend-collections-laws-crypto@1.0.0.0/src/math/f64.bend as F

164# 2^52 <= q < 2^53 is normal with fraction q - 2^52, q < 2^52 subnormal
165def pack_n(+s: Bool, +q: Nat, +u: Nat) -> F.F64:
166  pick(F.F64, C.fits(52n, q), encode(s, 0n, q), pack_e(s, Nat.sub(Nat.add(u, 1075n), zb()), C.low(52n, q)))

Uses (11)

Used by (1)