INumberBase<TSelf>.CreateTruncating<TOther>(TOther) Method

Definition

Creates an instance of the current type from a value, truncating any values that fall outside the representable range of the current type.

C#
public static virtual TSelf CreateTruncating<TOther>(TOther value) where TOther : System.Numerics.INumberBase<TOther>;

Type Parameters

TOther

The type of value.

Parameters

value
TOther

The value which is used to create the instance of TSelf.

Returns

TSelf

An instance of TSelf created from value, truncating if value falls outside the representable range of TSelf.

Exceptions

TOther is not supported.

Applies to

Product Versions
.NET 7, 8, 9, 10