IFloatingPoint<TSelf>.Round 方法

定义

重载

Round(TSelf)

使用默认舍入模式 () ToEven 将值舍入到最接近的整数。

Round(TSelf, Int32)

使用默认舍入模式 () ToEven 将值舍入到指定数量的小数位数。

Round(TSelf, MidpointRounding)

使用指定的舍入模式将值舍入到最接近的整数。

Round(TSelf, Int32, MidpointRounding)

使用指定的舍入模式将值舍入到指定数量的小数位数。

Round(TSelf)

Source:
IFloatingPoint.cs
Source:
IFloatingPoint.cs
Source:
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)

Source:
IFloatingPoint.cs
Source:
IFloatingPoint.cs
Source:
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

使用默认舍入 x 模式舍入到 digits 小数位数的结果。

适用于

Round(TSelf, MidpointRounding)

Source:
IFloatingPoint.cs
Source:
IFloatingPoint.cs
Source:
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

使用 modex入到最接近的整数的结果。

适用于

Round(TSelf, Int32, MidpointRounding)

Source:
IFloatingPoint.cs
Source:
IFloatingPoint.cs
Source:
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

使用 modex入到digits小数位数的结果。

适用于