def pack_n
import bend-collections-laws-math@1.0.0.0/spec/math/f64.bend as F64import Base
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as C
import bend-collections-laws-math@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)))