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 non rientrano nell'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 termina, questo metodo contiene un'istanza di TOther convertita da value.

Valori restituiti

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

Eccezioni

value non è rappresentabile da TOther.

Si applica a