def pack

bend-collections@1.0.0.0 · src/math/f64.bend:119

import bend-collections@1.0.0.0/src/math/f64.bend as F64
import Base
import bend-collections@1.0.0.0/src/math/u64.bend as W
import bend-collections@1.0.0.0/src/math/w64.bend as X

119# sign, exponent field e and significand m; the hidden bit of m (bit 52)
120# carries into the exponent field, as packToF64's addition does
121def pack(s: Bool, +e: Nat, +m: W.U64) -> F64:
122  pack64(X.add(W.U64{0, U32.add(sgn(s), U32.mul(U32.from_nat(e), 1048576))}, m))

Uses (10)

Used by (5)