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
value
TOtherThe value that's used to create the instance of
TSelf
.result
TSelfWhen this method returns, contains an instance of
TSelf
converted fromvalue
.
Returns
Type Parameters
TSelf
TOther
The type of
value
.
Exceptions
- OverflowException
value
is not representable byTSelf
.