UInt16.INumberBase<UInt16>.TryConvertToTruncating<TOther> 方法

定义

尝试将当前类型的实例转换为另一种类型,截断当前类型的可表示范围之外的任何值。

C#
static bool INumberBase<ushort>.TryConvertToTruncating<TOther>(ushort value, out TOther result) where TOther : System.Numerics.INumberBase<TOther>;

类型参数

TOther

应转换为的类型 value

参数

value
UInt16

用于创建 实例的值 TOther

result
TOther

此方法返回时,包含从 value转换的 实例TOther

返回

false 如果 TOther 不支持 ,则为 ;否则为 true

实现

适用于

产品 版本
.NET 7, 8, 9, 10