Single.Round 方法

定义

重载

名称 说明
Round(Single)

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

Round(Single, Int32)

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

Round(Single, MidpointRounding)

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

Round(Single, Int32, MidpointRounding)

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

Round(Single)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

public:
 static float Round(float x) = System::Numerics::IFloatingPoint<float>::Round;
public static float Round(float x);
static member Round : single -> single
Public Shared Function Round (x As Single) As Single

参数

x
Single

要舍入的值。

返回

使用默认舍入模式舍入 x 到最接近的整数的结果。

实现

适用于

Round(Single, Int32)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

public:
 static float Round(float x, int digits) = System::Numerics::IFloatingPoint<float>::Round;
public static float Round(float x, int digits);
static member Round : single * int -> single
Public Shared Function Round (x As Single, digits As Integer) As Single

参数

x
Single

要舍入的值。

digits
Int32

应舍入到的小 x 数位数。

返回

使用默认舍入模式舍入 xdigits 小数位数的结果。

实现

适用于

Round(Single, MidpointRounding)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

public:
 static float Round(float x, MidpointRounding mode) = System::Numerics::IFloatingPoint<float>::Round;
public static float Round(float x, MidpointRounding mode);
static member Round : single * MidpointRounding -> single
Public Shared Function Round (x As Single, mode As MidpointRounding) As Single

参数

x
Single

要舍入的值。

mode
MidpointRounding

应在其下舍入的 x 模式。

返回

使用 x. 将舍入mode到最接近的整数的结果。

实现

适用于

Round(Single, Int32, MidpointRounding)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

public:
 static float Round(float x, int digits, MidpointRounding mode) = System::Numerics::IFloatingPoint<float>::Round;
public static float Round(float x, int digits, MidpointRounding mode);
static member Round : single * int * MidpointRounding -> single
Public Shared Function Round (x As Single, digits As Integer, mode As MidpointRounding) As Single

参数

x
Single

要舍入的值。

digits
Int32

应舍入到的小 x 数位数。

mode
MidpointRounding

应在其下舍入的 x 模式。

返回

使用x小数位数舍入digitsmode小数位数的结果。

实现

适用于