# == (Equal to)

From Microduino Wiki

**==, !=, <, >（comparison operators）**

Comparison operators：

if(x == y) { // execute certain statements } //If x is equal to y, execute the statement in the brackets. if(x != y) //If x is not equal to y, execute the statement in the brackets. if(x < y) //If x is less than y, execute the statement in the brackets. if(x > y) //If x is larger than y, execute the statement in the brackets. if(x <= y) //If x is less than or equal to y, execute the statement in the brackets. if(x >= y) //If x is larger than or equal to y, execute the statement in the brackets.

**Note：**

When using the assignment operator（for example if (x = 10)）, single “=” is the assignment operator, which is to set the value of x as 10（put 10 into the internal storage of variable x）.

This is because C calculates according to the following rule if (x=10)：assign 10 to x（as long as it is the assignment statement of non-zero value, the result is always true），so the current value of x is 10. And at the same time, the test expression value is 10, and the value is always true, because non-zero values are always true.