显式数值转换用于通过显式转换表达式,将任何数字类型转换为任何其他数字类型。对于它不存在隐式转换。下表显示了这些转换。

sbyte

byteushortuintulongchar

byte

Sbyte 或者 char

short

sbyte byte ushort uint ulong char

ushort

sbyte byte short char

int

sbyte byte short ushort uint ulong char

uint

sbytebyte short ushort int char

long

sbyte byte short ushort int uint ulong char

ulong

sbyte byte short ushort int uint long char

char

sbytebyte short

float

sbyte byte short ushort int uint long ulong char decimal

double

sbyte byte short ushort int uint long ulong char float decimal

decimal

sbyte byte short ushort int uint long ulong char float double

Expand 图像备注

Expand image请参见