INumberBase<TSelf>.TryConvertToChecked<TOther> Método

Definição

Tenta converter uma instância do tipo atual em outro tipo, gerando uma exceção de estouro para todos os valores que ficam fora do intervalo representável do tipo atual.

protected:
generic <typename TOther>
 where TOther : System::Numerics::INumberBase<TOther> static bool TryConvertToChecked(TSelf value, [Runtime::InteropServices::Out] TOther % result);
protected static abstract bool TryConvertToChecked<TOther> (TSelf value, out TOther result) where TOther : System.Numerics.INumberBase<TOther>;
static member TryConvertToChecked : 'Self * 'Other -> bool (requires 'Other :> System.Numerics.INumberBase<'Other>)
Protected Shared Function TryConvertToChecked(Of TOther As INumberBase(Of TOther)) (value As TSelf, ByRef result As TOther) As Boolean

Parâmetros de tipo

TOther

O tipo no qual value deve ser convertido.

Parâmetros

value
TSelf

O valor usado para criar a instância do TOther.

result
TOther

Quando esse método retorna, contém uma instância de TOther convertida de value.

Retornos

false se TOther não houver suporte; caso contrário, true.

Exceções

value não é representável por TOther.

Aplica-se a