# History of \`isapprox\` in languages

**URL:** https://discourse.julialang.org/t/history-of-isapprox-in-languages/119347
**Category:** Numerics
**Tags:** question, numerics, approx
**Created:** [September 12, 2024, 6:51pm UTC](https://discourse.julialang.org/t/history-of-isapprox-in-languages/119347 "2024-09-12T18:51:09Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [September 12, 2024, 8:19pm UTC](https://discourse.julialang.org/t/history-of-isapprox-in-languages/119347/12 "2024-09-12T20:19:19Z")

</div>

How? You’re asking if something is approximately zero — and to do it “intuitively,” in the way that you mean. But how do I know what you mean, even if you’re explicitly using units? A high energy physicist might care about distances down to 10^-35m, but an architect would be okay with a millimeter or two and a GPS app happy to be within a meter.

Float64 can meaningfully represent over 600 orders of magnitude — and every single one of those orders of magnitude has ~16 digits of precision. You can always ask if ~half the digits match — that’s the default `rtol`. But how could I ever guess how many of those orders of magnitude should be considered “insignificant” to you? That’s the `atol`.

You can always define your own comparator — unicode combining characters or sub-/super-scripts are great for this:

```julia-repl
julia> ≈ₐ(x,y) = isapprox(x, y, atol=1e-10)
≈ₐ (generic function with 1 method)

julia> 1e-10 ≈ₐ 0.0
true

```

---

_[View the full topic](https://discourse.julialang.org/t/history-of-isapprox-in-languages/119347)._
