INumberBase<TSelf>.TryConvertFromChecked<TOther> Method

Definition

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.

C#
protected static abstract bool TryConvertFromChecked<TOther>(TOther value, out TSelf result) where TOther : System.Numerics.INumberBase<TOther>;

Type Parameters

TOther

The type of value.

Parameters

value
TOther

The value that's used to create the instance of TSelf.

result
TSelf

When this method returns, contains an instance of TSelf converted from value.

Returns

false if TOther is not supported; otherwise, true.

Exceptions

value is not representable by TSelf.

Applies to

Product Versions
.NET 7, 8, 9, 10