def int_part

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

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

360# the integer part of |x| (x finite)
361def int_part(+x: F.F64) -> Nat:
362  pick(Nat, Nat.is_le(zb(), xexp(x)), C.shift(Nat.sub(xexp(x), zb()), mant(x)), C.high(Nat.sub(zb(), xexp(x)), mant(x)))

Uses (10)

Used by (2)