def IsInteger.value

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

import bend-collections-laws-math@1.0.0.0/spec/math/f64.bend as F64
import 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

487# finite with no fractional bits
488def IsInteger.value(+x: F.F64) -> Type:
489  {F.is_integer(x) == Bool.and(Nat.is_lt(efield(x), 2047n), Bool.or(Nat.is_le(zb(), xexp(x)), Nat.is_eq(C.low(Nat.sub(zb(), xexp(x)), mant(x)), 0n))) : Bool}

Uses (14)

Used by (1)