Appendix A. Operator Precedence Chart

Operators are shown in decreasing order of precedence from top to bottom with each level of precedence separated by a horizontal line. The associativity of the operators is shown in the right column.

Figure A.1. Operator precedence chart.

Operator

Type

Associativity

.

member access

left-to-right

()

method call

 

[]

element access

++

postfix increment

--

postfix decrement

new

object creation

typeof

get System.Type object for a type

sizeof

get size in bytes of a type

checked

checked evaluation

unchecked

unchecked evaluation

 

+

unary plus

right-to-left

-

unary minus

!

logical negation

~

bitwise complement

++

prefix increment

--

prefix decrement

(type)

cast

 

*

multiplication

left-to-right

/

division

 

%

remainder

 

+

addition

left-to-right

-

subtraction

 

>>

right shift

left-to-right

<<

left shift

 

<

less than

left-to-right

>

greater than

 

<=

less than or equal to

 

>=

greater than or equal to

 

is

type comparison

 

as

type conversion

 

!=

is not equal to

left-to-right

==

is equal to

 

&

logical AND

left-to-right

^

logical XOR

left-to-right

|

logical OR

left-to-right

&&

conditional AND

left-to-right

||

conditional OR

left-to-right

??

null coalescing

right-to-left

?:

conditional

right-to-left

=

assignment

right-to-left

*=

multiplication assignment

 

/=

division assignment

 

%=

remainder assignment

 

+=

addition assignment

 

-=

subtration assignment

 

<<=

left shift assignment

 

>>=

right shift assignment

 

&=

logical AND assignment

 

^=

logical XOR assignment

 

|=

logical OR assignment

 

Appendix B Number Systems

Категории