13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>C#</strong> LANGUAGE SPECIFICATIONWhen overload resolution rules (§14.4.2) are applied to this set of operators, the effect is to select the first ofthe operators for which implicit conversions exist from the operand types. [Example: For example, for theoperation b * s, where b is a byte and s is a short, overload resolution selects operator *(int, int)as the best operator. Thus, the effect is that b and s are converted to int, and the type of the result is int.Likewise, for the operation i * d, where i is an int and d is a double, overload resolution selectsoperator *(double, double) as the best operator. end example]End of informative text.14.2.6.1 Unary numeric promotionsThis clause is informative.Unary numeric promotion occurs for the operands of the predefined +, –, and ~ unary operators. Unarynumeric promotion simply consists of converting operands of type sbyte, byte, short, ushort, or charto type int. Additionally, for the unary – operator, unary numeric promotion converts operands of typeuint to type long.End of informative text.14.2.6.2 Binary numeric promotionsThis clause is informative.Binary numeric promotion occurs for the operands of the predefined +, –, *, /, %, &, |, ^, ==, !=, >, =,and

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!