C#_ operator

Source: Internet
Author: User

Data type:

Big class Small class C # language . NET language (Common language) Description Size (bytes) Value Range
Base data type (value type) Plastic SByte SByte 8-bit signed integer 1 -128~127 (negative 2 of 7 square ~ Positive 2 of 7 times minus 1)
Short Int16 16-bit signed integer 2 -32768~32767 (negative 2 of 15 square ~ Positive 2 of 15 times minus 1)
Int Int32 32-bit signed integer 3 (negative 2 of 31 square ~ Positive 2 of 31 times minus 1)
Long Int64 64-bit signed integer 4 (negative 2 of 63 square ~ Positive 2 of 63 times minus 1)
Byte Byte 8-bit unsigned integer 1 0~255 (0~2 8-time minus 1)
UShort UInt16 16-bit unsigned integer 2 (0~2 16-time minus 1)
UInt UInt32 32-bit unsigned integer 3 (0~2 32-time minus 1)
ULong UInt64 64-bit unsigned integer 4 (0~2 64-time minus 1)
Floating point Type Float Single 32-bit single-precision floating-point number 4 1.5x10−45 to 3.4x10
Double Double 64-bit double-precision floating-point number 8 5.0x10−324 to 1.7x10308
Decimal Decimal 128 precision floating point number 16 1.0x10−28 to about 7.9x10
Character type Char Char 16-bit Unicode characters, which are placed in the "characters" 2
Boolean type bool Boolean Indicates true or FALSE 1
Date Time Datetime Datetime
Structural body struct Struct
Enum type Enum Enum
Reference type String type String String
Class
Array
Collection

Operator Precedence:

Priority level Operator Name or meaning Use form Combination direction Description
1 ( ) Parentheses (expression)/function name (formal parameter list)
2 Type Forcing type conversions (data type) expression
++ Self-increment operator + + variable name/variable name + + Monocular operator
-- Self-decrement operator --Variable name/variable name-- Monocular operator
! Logical non-operator ! An expression Monocular operator
3 / Except An expression/expression Left to right Binocular operator
* By Expression-expression * Binocular operator
% Remainder (modulo) Integer expression% integer expression Binocular operator
4 + Add An expression + an expression Left to right Binocular operator
- Reducing Expression-expression Binocular operator
5 > Greater than Expressions > expressions Left to right Binocular operator
>= Greater than or equal Expression->= expression Binocular operator
< Less than Expressions < expressions Binocular operator
<= Less than or equal Expression-<= expression Binocular operator
6 == Equals Expression-= = Expression Left to right Binocular operator
!= Not equal to Expression! = Expression Binocular operator
7 && Logic and Expressions && Expressions Left to right Binocular operator
8 || Logical OR An expression | | An expression Left to right Binocular operator
9 ?: Conditional operators Expression 1? Expression 2: Expression 3 Right to Left Trinocular operator
10 = Assignment operators variable = expression Right to Left
/= Assign value after addition Variable-/= expression
*= Multiply post-Assign value Variable-*= expression
%= Assign value after modulo Variable-%= expression
+= Add after Assignment Variable + = expression
-= Reduced-value Assignment Variable-= expression

C#_ operator

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.