Int32.CreateTruncating<TOther>(TOther) 方法

定義

從值建立目前型別的實例,截斷落在目前類型可表示範圍以外的任何值。

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

類型參數

TOther

value 的類型。

參數

value
TOther

用來建立 實例的值 TSelf

傳回

value 建立的 TSelf 實例,如果 value 落在 可表示的範圍 TSelf 之外,則會截斷 。

實作

適用於

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