== | True if the expressions left and right of the operator are equal. |

!= | True if the expressions left and right of the operator are not equal. |

> | True if the expression
left of the operator is greater than
the expression right of the operator. |

>= | True if the expression
left of the operator is greater than
or equal to the expression right of the operator. |

< | True if the expression
right of the operator is greater than
the expression left of the operator. |

<= | True if the expression
right of the operator is greater than
or equal to the expression left of the operator. |

&& | True if the expressions left and right of the operator are both true. |

|| | True if either of the expressions left and right of the operator is true. |

! | LC True if the expression right of the operator is not true. |

() | Brackets, for defining the priority of comparisions. Always use brackets when priority matters! |

- !! The "equals" comparison is done with '==', to differentiate
it from the assignment instruction with '
**=**'. Wrongly using '=' instead of "==" is not noticed by the compiler because it's a valid assignment, but is one of the most frequent bugs in scripts. - !!
Only pointers and integer variables (
**int**,**long**,**char**etc., and**var**without decimals) can be compared with '==' or '!='. Due to the limited precision of variables in computer languages, a number with decimals - f.i.**0.1**- has a different internal value dependent on whether it's a constant, or assigned to a**var**, a**float**, or a**double**. Different types of**0.1**will normally not be equal in a comparison. Therfore, only 'greater' or 'less' comparisons can be used for floating point variables, vars with decimals, or results of non-integer expressions in all computer languages. - !!
For comparing the content of strings, use str_cmp. The comparison
**'=='**would not compare the string contents, but their pointers, which are normally not equal even if the strings contain the same text. For comparing the content of structs, compare their elements. - !!
The precedence of comparison and expression operators follows the C/C++ standard. Use parentheses in case of doubt. For instance, the expressions
**(x & y == z)**and**((x & y) == z)**give different results because the**&**operator has lower precedence than the**==**operator.

10 < x// true if x is greater than 10(10 <= x) && (15 => x)// true if x is between 10 and 15!((10 <= x) && (15 => x))// true if x is less than 10 or greater than 15 (lite-C only)

See also:

Functions, Variables, Pointers, Expressions► latest version online