def to_float

bend-collections@1.0.0.0 · src/math/random/rand.bend:239

import bend-collections@1.0.0.0/src/math/random/rand.bend as Rand
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
import bend-collections@1.0.0.0/src/math/f64.bend as F

239# Go's Float64: float64(x << 11 >> 11) / (1 << 53), the low 53 bits
240def to_float(+x: W.U64) -> F.F64:
241  f53_z(W.U64{X.lo(x), U32.and(X.hi(x), 2097151)}, X.is_zero(W.U64{X.lo(x), U32.and(X.hi(x), 2097151)}))

Uses (7)

Used by (1)