INumberBase<TSelf>.TryConvertToChecked<TOther> Metodo

Definizione

Tenta di convertire un'istanza del tipo corrente in un altro tipo, generando un'eccezione di overflow per tutti i valori che rientrano all'esterno dell'intervallo rappresentabile del tipo corrente.

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

Parametri di tipo

TOther

Tipo in cui value deve essere convertito.

Parametri

value
TSelf

Valore utilizzato per creare l'istanza di TOther.

result
TOther

Quando questo metodo restituisce, contiene un'istanza di TOther convertita da value.

Restituisce

false se non è supportato; in caso TOther contrario, true.

Eccezioni

value non rappresentabile da TOther.

Si applica a