OpCodes.Conv_U2 Campo

Definição

Converte o valor na parte superior da pilha de avaliação em unsigned int16 e estende-o para int32.Converts the value on top of the evaluation stack to unsigned int16, and extends it to int32.

public: static initonly System::Reflection::Emit::OpCode Conv_U2;
public static readonly System.Reflection.Emit.OpCode Conv_U2;
 staticval mutable Conv_U2 : System.Reflection.Emit.OpCode
Public Shared ReadOnly Conv_U2 As OpCode 

Valor do campo

OpCode

Comentários

A tabela a seguir lista o formato de assembly hexadecimal e da MSIL (Microsoft Intermediate Language) da instrução, juntamente com um resumo de referência breve:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

FormatarFormat Formato do assemblyAssembly Format DescriçãoDescription
D1D1 conv. U2conv.u2 Converter em int16 e enviar int32 por push na pilha.Convert to int16, pushing int32 on stack.

O comportamento de transição de pilha, em ordem sequencial, é:The stack transitional behavior, in sequential order, is:

  1. value é enviado por push para a pilha.value is pushed onto the stack.

  2. value é retirado da pilha e a operação de conversão é tentada.value is popped from the stack and the conversion operation is attempted.

  3. Se a conversão for bem-sucedida, o valor resultante será enviado por push para a pilha.If the conversion is successful, the resulting value is pushed onto the stack.

O conv.u2 opcode converte o value no topo da pilha para o tipo especificado no opcode e deixa esse valor convertido na parte superior da pilha.The conv.u2 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Valores inteiros de menos de 4 bytes são estendidos para int32 quando eles são carregados na pilha de avaliação (a menos que conv.i ou conv.u seja usado, caso em que o resultado também é native int ).Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also native int). Valores de ponto flutuante são convertidos para o F tipo.Floating-point values are converted to the F type.

A conversão de números de ponto flutuante para valores inteiros trunca o número em direção a zero.Conversion from floating-point numbers to integer values truncates the number toward zero. Ao converter de um float64 para um float32 , a precisão pode ser perdida.When converting from an float64 to an float32, precision can be lost. Se value for muito grande para caber em um float32 (F) infinito positivo (se value for positivo) ou infinito negativo (se value for negativo) for retornado.If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. Se o estouro ocorrer ao converter um tipo inteiro em outro, os bits de ordem superior serão truncados.If overflow occurs converting one integer type to another, the high order bits are truncated. Se o resultado for menor do que um int32 , o valor será de entrada estendida para preencher o slot.If the result is smaller than an int32, the value is sign-extended to fill the slot.

Se o estouro ocorrer ao converter um tipo de ponto flutuante para um inteiro, o valor retornado não será especificado.If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

Nenhuma exceção é gerada ao usar esse campo.No exceptions are ever thrown when using this field. Consulte Conv_Ovf_I2 e Conv_Ovf_I2_Un para obter instruções equivalentes que gerarão uma exceção quando o tipo de resultado não puder representar corretamente o valor do resultado.See Conv_Ovf_I2 and Conv_Ovf_I2_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

A sobrecarga do método a seguir Emit pode usar o conv.u2 opcode:The following Emit method overload can use the conv.u2 opcode:

Aplica-se a