# More about operators and boolean in go

M

An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. There are many operators in GO

• Arithmetic Operators
• Relational Operators
• Logical Operators
• Bitwise Operators
• Assignment Operators
• Miscellaneous Operators

I’ll try to cover them as much as I can.

We already know about Arithmetic operators So I’m not gonna cover them again. Here’s a picture to recall.

Now before talking about other operators I must explain about booleans. So from my previous article I said variable are nothing but holds some value. One value it can hold is Boolean.

A boolean is nothing but True or False.

I can say like

## Relational Operators

Go uses this boolean in many areas. For example to ask whether one is greater than the other.

## logical operators

Its mostly used to combine relational operations,

&& means and

|| means or

! means not

We’ll use more of this conditional making and looping in the upcoming articles.

## Bitwise operators

So I suppose you guys know that computer works in binary. It knows nothing but 1 or 0.

I won’t explain you explain why binary but I can say that its easy to switch states if there’s only two. And you can think of it as ON or OFF.

Is there a current in this wire or not?

## Assignment operators

We already know a assignment operator ‘=’

`var a int = 5` here = is a assignment operator.

But there are many assignment operators in GO

+=, -=, *=, /= etc. The idea here is simple.

`a += 3` is same as `a = a + 3`. Its the same for others assignment operators as well like `a -=3` is same as `a = a - 3`.

## Miscellaneous Operators

We have other operators like ?:, sizeof, *, etc.

But I think they all deserve a separate article.

Hope you guys liked it. Bye