def frexp
bend-collections-laws-crypto@1.0.0.0 · spec/math/f64.bend:412
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/src/math/f64.bend as F
import bend-collections-laws-crypto@1.0.0.0/src/math/natural.bend as M
412
413
414
415def frexp(+x: F.F64) -> F.F64 & F.Exp:
416 pickt(F.F64 & F.Exp, is_nan(x), (qnan(), F.Exp{False{}, 0n}), pickt(F.F64 & F.Exp, Bool.or(is_inf(x), is_zero(x)), (x, F.Exp{False{}, 0n}), (round(sign(x), mant(x), Nat.sub(zb(), M.bit_length(mant(x)))), exp_of(Nat.add(xexp(x), M.bit_length(mant(x)))))))