def ic_near

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

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/src/math/f64.bend as F

553# CPython's math.isclose, computed in binary64: a negative tolerance is a
554# domain error; a == b is close, an infinity is close only to itself, and
555# otherwise |b - a| <= max(|rel * b|, |rel * a|, abs_tol) (4.4)
556def ic_near(+a: F.F64, +b: F.F64, +rel: F.F64, +at: F.F64, +d: F.F64) -> Bool:
557  Bool.or(Bool.or(le_s(d, fabs(mul(rel, b))), le_s(d, fabs(mul(rel, a)))), le_s(d, at))

Uses (6)

Used by (6)