# Less than approx equals? \<≈

**URL:** <https://discourse.julialang.org/t/less-than-approx-equals/45436>\
**Category:** New to Julia\
**Created:** [August 23, 2020, 11:41pm UTC](https://discourse.julialang.org/t/less-than-approx-equals/45436 "2020-08-23T23:41:20Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![mforets](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mforets/32/298_2.png) [@mforets](https://discourse.julialang.org/u/mforets)\
**Post date:** [August 24, 2020, 8:59pm UTC](https://discourse.julialang.org/t/less-than-approx-equals/45436/11 "2020-08-24T20:59:01Z")

</div>

> [@anon92994695](#):
>
> So I checked for that branch and don’t see it in there, also checked your fork and didn’t see it in there, might still be local?

Oops, it’s already been merged, and the branch deleted. You can checkout the `master` branch or wait to the next patch release, probably tomorrow…

> I quickly looked at the code for \_leq in LazySets but I didn’t really understand it. Is it overloading from Base?

See [this function](https://github.com/JuliaReach/LazySets.jl/blob/master/src/Utils/comparisons.jl#L407), that I copy here for convenience:

```julia
function _leq(x::N, y::N;
              rtol::Real=_rtol(N),
              ztol::Real=_ztol(N),
              atol::Real=_atol(N)) where {N<:AbstractFloat}
    return x <= y || _isapprox(x, y, rtol=rtol, ztol=ztol, atol=atol)
end

```

It doesn’t overload functions from Base, it simply uses an internal `_isapprox` for approximate equality comparisons, with tolerances that can be set at once (globally) for all operations. Some problems require very small tolerances, for other problems you can work with bigger tolerances so it’s useful to be able to change everything with one command (like tests for disjointness, inclusion, membership, etc).

> What are your thoughts about introducing a \<≈ operator into Julia Base? Is it too specialized?

I think that’s not justified, the building blocks are already in Base, and the actual meaning of approximate `<=` depends a lot on the application (as suggested above).

---

_[View the full topic](https://discourse.julialang.org/t/less-than-approx-equals/45436)._
