MS-help: //ms.vscc.2003/ms.msdnqtr.2003feb.2052/csref/html/vclrfcsharpoperty.htm
C # programmer reference
C # operator
See
7.2.1 Priority and sequential correlation of the operator
Overloaded operator | C # Keywords | C # programmer reference
C # provides a large number of operators that specify which operations are executed in the expression. C # predefined usually arithmetic and logical operators and various other operators displayed in the table below. In addition, many operators can be overloaded by the user, thereby changing the meaning of these operators when applying to the user-defined type.
Operator category operator count - * /% logic (Boolean and bits) & | ^! ~ && || True False string series increment, decrement - shift << >> relationship ==! = <> <=> = Assignment = = - = * = / =% = & = | = ^ = << = >> = member access. Index [] conversion () condition?: Delegate series and removal - Create an object NEW type information AS is sizeof typeof overflow exception control Checked unchecked indirect addressing and address * -> [] &
Arithmetic overflow
The results of arithmetic operators ( , -, *, /) may exceed the range of possible values involved. You should refer to the details of the specific operator in the C # Language Reference section, but in general:
Integer arithmetic overflow or trigger overflowexception or the highest significant bit of the abandonment result (see below). The integer is zero to always trigger DivideByzeroException. Floating point arithmetic overflow or zero-free from no abnormal abnormality, because the floating point type is based on IEEE 754, so it can represent infinity and NAN (not a number). Decimal arithmetic overflow always triggers overflowexception. Decimal is always caused by DivideByzeroException.
When an integer overflow occurs, the resulting result depends on the execution context, which can be checked or unchecked. The overflowexception is triggered in the selected context. In the unselected context, the highest effective bit of the result is given and proceed. Therefore, C # allows you to choose or ignore overflow.
In addition to the arithmetic operator, the conversion between interstitations can also result in overflow (eg, converting long into int) and is selected or unchecked. Also note that the bit-bit operator and shift operator never cause overflow.
See
7.2.1 Priority and sequential correlation of the operator
Overloaded operator | C # Keywords | C # programmer reference