QuakeC Operators

From Quake Wiki

Logical operations[edit]

    !   // logical not
    &&  // logical and
    ||  // logical or

Take care that in if() conditional expressions containing two or more logical clauses, all the clauses will be evaluated before the condition test (like in Basic, and unlike C).

That means that if one part of your condition is not always valid or defined, you had better decompose your if() into two successive if(). It should also make it faster. Comparisons

    <=    <      >=     >  
    ==  // equal, beware at the double = like in C.
    !=  // not equal, like in C.

Operations on floats or integer[edit]

    *  /  -  +

Use parenthesis to remove ambiguities.

Those operators perform bitwise operations on integers:

   &   // bitwise and
   |   // bitwise or

These operators treat floats like integers, so they are usually meant to be used with values made of bit masks.