# The test isequal(+0.0,-0.0) returns FALSE

**URL:** https://discourse.julialang.org/t/the-test-isequal-0-0-0-0-returns-false/38404
**Category:** Numerics
**Tags:** isequal
**Created:** [April 29, 2020, 2:13am UTC](https://discourse.julialang.org/t/the-test-isequal-0-0-0-0-returns-false/38404 "2020-04-29T02:13:19Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 29, 2020, 2:38am UTC](https://discourse.julialang.org/t/the-test-isequal-0-0-0-0-returns-false/38404/8 "2020-04-29T02:38:35Z")

</div>

What you might do is something like:

```julia
unique(x -> round(x, sigdigits=13), myarray)

```

which would perform the `unique` operation based on the first 13 significant digits. (You could use `digits` instead of `sigdigits` if you want an absolute tolerance).

But this might not necessarily be what you want, e.g. `unique(x -> round(x, sigdigits=13), [1.000000000000501, 1.0000000000005])` gives `[1.000000000000501, 1.0000000000005]` because those two values round differently in the 13th decimal digit. (Again, the fact that approximate equality is not an equivalence relation — it’s not transitive — means that _any_ implementation of `unique` with a tolerance will have some odd behaviors.)

---

_[View the full topic](https://discourse.julialang.org/t/the-test-isequal-0-0-0-0-returns-false/38404)._
