Appendix C

Operators

Also see Appendix G for the order of precedence.

Operator

Type

Function

+

Math

Addition

Math

Subtraction

*

Math

Multiplication

/

Math

Division

%

Math

Modulo

++

Math

Increment

--

Math

Decrement

+

Math

Unary plus

Math

Unary minus

=

Assignment

Assigns a value to a variable

+=

Assignment

Addition

-=

Assignment

Subtraction

*=

Assignment

Multiplication

/=

Assignment

Division

%=

Assignment

Modulo

!=

Comparison

Not equal

<

Comparison

Less than

<=

Comparison

Less than or equal to

==

Comparison

Is equal to

>

Comparison

Greater than

>=

Comparison

Greater than or equal to

&&

Logical

Both comparisons are true

||

Logical

Either comparison is true

!

Logical

The item is false

&

Bitwise

Mask bits

|

Bitwise

Set bits

^

Bitwise

Exclusive or (XOR)

~

Unary

One’s complement

!

Unary

NOT

*

Unary

Pointer (peeker)