IFloatingPoint<TSelf>.Round 方法

定義

多載

Round(TSelf)

使用預設四捨五入模式將值四捨五入為最接近的整數, (ToEven) 。

Round(TSelf, Int32)

使用預設四捨五入模式,將值四捨五入為指定的小數位數, (ToEven) 。

Round(TSelf, MidpointRounding)

使用指定的進位模式,將值四捨五入為最接近的整數。

Round(TSelf, Int32, MidpointRounding)

使用指定的四捨五入模式,將值四捨五入為指定的小數位數。

Round(TSelf)

來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs

使用預設四捨五入模式將值四捨五入為最接近的整數, (ToEven) 。

public:
 static override TSelf Round(TSelf x);
public static virtual TSelf Round (TSelf x);
static member Round : 'Self -> 'Self
Public Shared Overrides Function Round (x As TSelf) As TSelf

參數

x
TSelf

要捨入的值。

傳回

TSelf

使用預設四捨五入模式四捨五入 x 至最接近整數的結果。

適用於

Round(TSelf, Int32)

來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs

使用預設四捨五入模式,將值四捨五入為指定的小數位數, (ToEven) 。

public:
 static override TSelf Round(TSelf x, int digits);
public static virtual TSelf Round (TSelf x, int digits);
static member Round : 'Self * int -> 'Self
Public Shared Overrides Function Round (x As TSelf, digits As Integer) As TSelf

參數

x
TSelf

要捨入的值。

digits
Int32

應該四捨五入的小數位數 x

傳回

TSelf

使用預設四捨五入模式四捨五入 xdigits 小數位數的結果。

適用於

Round(TSelf, MidpointRounding)

來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs

使用指定的進位模式,將值四捨五入為最接近的整數。

public:
 static override TSelf Round(TSelf x, MidpointRounding mode);
public static virtual TSelf Round (TSelf x, MidpointRounding mode);
static member Round : 'Self * MidpointRounding -> 'Self
Public Shared Overrides Function Round (x As TSelf, mode As MidpointRounding) As TSelf

參數

x
TSelf

要捨入的值。

mode
MidpointRounding

應該四捨五入的 x 模式。

傳回

TSelf

使用 mode四捨五入x為最接近整數的結果。

適用於

Round(TSelf, Int32, MidpointRounding)

來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs
來源:
IFloatingPoint.cs

使用指定的四捨五入模式,將值四捨五入為指定的小數位數。

public:
 static TSelf Round(TSelf x, int digits, MidpointRounding mode);
public static abstract TSelf Round (TSelf x, int digits, MidpointRounding mode);
static member Round : 'Self * int * MidpointRounding -> 'Self
Public Shared Function Round (x As TSelf, digits As Integer, mode As MidpointRounding) As TSelf

參數

x
TSelf

要捨入的值。

digits
Int32

應該四捨五入的小數位數 x

mode
MidpointRounding

應該四捨五入的 x 模式。

傳回

TSelf

使用 mode四捨五入xdigits小數位數的結果。

適用於