def isclose

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

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/num.bend as N

559def isclose(+a: F.F64, +b: F.F64, +rel: F.F64, +at: F.F64) -> Result<&2, &2, N.NumError, Bool>:
560  pick(Result<&2, &2, N.NumError, Bool>, Bool.or(lt_s(rel, zero(False{})), lt_s(at, zero(False{}))), Fail{N.BadDomain{}}, Done{pick(Bool, eq_s(a, b), True{}, pick(Bool, Bool.or(is_inf(a), is_inf(b)), False{}, ic_near(a, b, rel, at, fabs(add(b, neg(a))))))})

Uses (14)

Used by (1)