# Assignment operator and operator equal

**URL:** <https://forum.crystal-lang.org/t/assignment-operator-and-operator-equal/3083>\
**Category:** Help & Support\
**Created:** [March 25, 2021, 12:57pm UTC](https://forum.crystal-lang.org/t/assignment-operator-and-operator-equal/3083 "2021-03-25T12:57:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cytorak87](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/cytorak87/32/1201_2.png) [@cytorak87](https://forum.crystal-lang.org/u/cytorak87)\
**Post date:** [March 25, 2021, 12:57pm UTC](https://forum.crystal-lang.org/t/assignment-operator-and-operator-equal/3083/1 "2021-03-25T12:57:05Z")

</div>

Hi everyone ❤ .  
I read the documentation, but I still don’t understand if there is an equal operator in Crystal. I used the assignment operator to designate my variables, but for example I need to equalize a variable, how can I do this?  
e.g:  
`if a = 5`  
`if a == 5` ← Could it be in Crystal? I tried to find info, but I couldn’t …  
Thanks everyone for the help! 🤝

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [March 25, 2021, 1:08pm UTC](https://forum.crystal-lang.org/t/assignment-operator-and-operator-equal/3083/2 "2021-03-25T13:08:18Z")

</div>

```auto
a = 5

a # => 5

b = 6

b # => 6

if a == b
  puts "equal"
else
  puts "not equal"
end
# => not equal

```

Ref: [Operators - Crystal](https://crystal-lang.org/reference/syntax_and_semantics/operators.html#equality) and [Assignment - Crystal](https://crystal-lang.org/reference/syntax_and_semantics/assignment.html).

---

<div class="post-metadata">

**Author:** ![cytorak87](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/cytorak87/32/1201_2.png) [@cytorak87](https://forum.crystal-lang.org/u/cytorak87)\
**Post date:** [March 25, 2021, 1:09pm UTC](https://forum.crystal-lang.org/t/assignment-operator-and-operator-equal/3083/3 "2021-03-25T13:09:36Z")

</div>

Thank you so much! Apparently I missed it in the documentation 🤝
