# How to compare vectors?

**URL:** <https://discourse.julialang.org/t/how-to-compare-vectors/121295>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 14, 2024, 4:16pm UTC](https://discourse.julialang.org/t/how-to-compare-vectors/121295 "2024-10-14T16:16:31Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 14, 2024, 4:59pm UTC](https://discourse.julialang.org/t/how-to-compare-vectors/121295/8 "2024-10-14T16:59:37Z")

</div>

See for one of the more recent ones:

> [@History of \`isapprox\` in languages](https://discourse.julialang.org/t/history-of-isapprox-in-languages/119347):
>
> Does anyone know why the de-facto standard definition of isapprox intentionally fails when one of the arguments is zero? isapprox(0.0, 0.0 + 1e-10) # false isapprox(1.0, 1.0 + 1e-10) # true It is clear from the formula why this is happening: ||x - y|| \le max(atol, rtol\*max(||x||, ||y||)) If we set y=0, we get: ||x|| \le max(atol, rtol\*||x||) The default atol = 0 then makes it: ||x|| \le rtol \* ||x|| and the default rtol = \sqrt\epsilon leads to: ||x|| \le \sqrt\epsilon ||x|| which…

---

_[View the full topic](https://discourse.julialang.org/t/how-to-compare-vectors/121295)._
