Method TryConvertFromChecked
- Namespace
- Zyl.VectorTraits.Numerics
- Assembly
- VectorTraits.dll
TryConvertFromChecked<TSelf, TOther>(TOther, out TSelf)
Tries to convert a value to an instance of the the current type, throwing an overflow exception for any values that fall outside the representable range of the current type.
public static extern bool TryConvertFromChecked<TSelf, TOther>(TOther value, out TSelf result) where TSelf : INumberBase<TSelf> where TOther : INumberBase<TOther>
Parameters
valueTOtherThe value that's used to create the instance of
TSelf.resultTSelfWhen this method returns, contains an instance of
TSelfconverted fromvalue.
Returns
Type Parameters
TSelfTOtherThe type of
value.
Exceptions
- OverflowException
valueis not representable byTSelf.