# Is their any clear documentation that outlines what == and === does?

**URL:** <https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232>\
**Category:** General Usage\
**Created:** [November 16, 2020, 4:52pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232 "2020-11-16T16:52:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon60034542](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Post date:** [November 16, 2020, 4:52pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/1 "2020-11-16T16:52:30Z")

</div>

I’ve searched the documentation but was unable to find it. I found this answer on [SO](https://stackoverflow.com/a/38638838), however does any documentation exist that explains it?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 16, 2020, 4:55pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/2 "2020-11-16T16:55:49Z")

</div>

type `?` followed by `==` or `===` 🙂

```julia
help?> ===
search: === == !==

  ===(x,y) -> Bool
  ≡(x,y) -> Bool

  Determine whether x and y are identical, in the sense that no program could distinguish them. First the
  types of x and y are compared. If those are identical, mutable objects are compared by address in memory
  and immutable objects (such as numbers) are compared by contents at the bit level. This function is
  sometimes called "egal". It always returns a Bool value.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> a = [1, 2]; b = [1, 2];
  
  julia> a == b
  true
  
  julia> a === b
  false
  
  julia> a === a
  true

```

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 16, 2020, 4:57pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/3 "2020-11-16T16:57:07Z")

</div>

It would be good to add that answer I wrote to the manual in the appropriate place though. Would be great if someone wanted to figure out where that is an make a pull request.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 16, 2020, 4:59pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/4 "2020-11-16T16:59:41Z")

</div>

Yet another issue is that searching for `==` or `===` in the docs retrieves nothing. There was a recent post somewhere where someone asked for a dictionary of the names of the operators. For example, I am not sure what I should search for if I was looking for those and the search for the symbol does not lead me the right doc page.

I guess the page is this one: [Missing Values · The Julia Language](https://docs.julialang.org/en/v1/manual/missing/#Equality-and-Comparison-Operators)

(“egal” returns nothing, but “equal to” takes us there)

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [November 16, 2020, 5:55pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/5 "2020-11-16T17:55:13Z")

</div>

I managed to find [Base.:==](https://docs.julialang.org/en/v1/base/math/#Base.:==) and [Core.:===](https://docs.julialang.org/en/v1/base/base/#Core.:===) in the docs, but it wasn’t straightforward. `===` in the search bar gave no results, and `==` didn’t give a link to the docs for `==`. However, a couple of those results were [Base.:!=](https://docs.julialang.org/en/v1/base/math/#Base.:!=) and [Base.:!==](https://docs.julialang.org/en/v1/base/math/#Base.:!==), whose docs linked to their opposites.  
I had trouble finding things in the docs with the search bar before, but I didn’t expect it for the `==` and `===` operators, just seems like if the REPL’s `help?>` can do it, so should the search bar.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 17, 2020, 12:36pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/6 "2020-11-17T12:36:32Z")

</div>

> [@StefanKarpinski](#):
>
> Would be great if someone wanted to figure out where that is an make a pull request.

It’s on my agenda — I think it would be best to make a section about `===` in [the mathematical operations and elementary](https://docs.julialang.org/en/v1/manual/mathematical-operations/) chapter since `==` and `isequal` are already there and after all `===` is one of the most elementary operations, and then

1. contrast `===` with `==` and `isequal`,
2. incorporate some conceptual explanation about equality from Kent Pitman’s [famous post on Lisp](https://www.nhplace.com/kent/PS/EQUAL.html),
3. explain what’s going on with `mutable struct` and `struct`, including corner cases,
4. relate to hashing,
5. suggest that if the user is unsatisfied with the existing comparison semantics, they should feel free to go ahead and define their own, with the tons of symbols available like `≅`.

Anything I missed, please make a suggestion.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 17, 2020, 1:14pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/7 "2020-11-17T13:14:00Z")

</div>

Brilliant!

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [November 17, 2020, 1:18pm UTC](https://discourse.julialang.org/t/is-their-any-clear-documentation-that-outlines-what-and-does/50232/8 "2020-11-17T13:18:29Z")

</div>

And maybe this is obvious but a link to this section should be put in the `Base.:==` and `Core.:===` sections in the Base docs, too, I think it’s just that important and common of a question to have.
