Double.Round 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Round(Double) |
使用默认舍入模式将值舍入到最接近的整数(ToEven)。 |
| Round(Double, Int32) |
使用默认舍入模式将值舍入为指定数量的小数位数(ToEven)。 |
| Round(Double, MidpointRounding) |
使用指定的舍入模式将值舍入到最接近的整数。 |
| Round(Double, Int32, MidpointRounding) |
使用默认舍入模式将值舍入为指定数量的小数位数(ToEven)。 |
Round(Double)
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
使用默认舍入模式将值舍入到最接近的整数(ToEven)。
public:
static double Round(double x) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round(double x);
static member Round : double -> double
Public Shared Function Round (x As Double) As Double
参数
- x
- Double
要舍入的值。
返回
使用默认舍入模式舍入 x 到最接近的整数的结果。
实现
适用于
Round(Double, Int32)
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
使用默认舍入模式将值舍入为指定数量的小数位数(ToEven)。
public:
static double Round(double x, int digits) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round(double x, int digits);
static member Round : double * int -> double
Public Shared Function Round (x As Double, digits As Integer) As Double
参数
- x
- Double
要舍入的值。
- digits
- Int32
应舍入到的小 x 数位数。
返回
使用默认舍入模式舍入 x 到 digits 小数位数的结果。
实现
适用于
Round(Double, MidpointRounding)
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
使用指定的舍入模式将值舍入到最接近的整数。
public:
static double Round(double x, MidpointRounding mode) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round(double x, MidpointRounding mode);
static member Round : double * MidpointRounding -> double
Public Shared Function Round (x As Double, mode As MidpointRounding) As Double
参数
- x
- Double
要舍入的值。
- mode
- MidpointRounding
应在其下舍入的 x 模式。
返回
使用 x. 将舍入mode到最接近的整数的结果。
实现
适用于
Round(Double, Int32, MidpointRounding)
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
- Source:
- Double.cs
使用默认舍入模式将值舍入为指定数量的小数位数(ToEven)。
public:
static double Round(double x, int digits, MidpointRounding mode) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round(double x, int digits, MidpointRounding mode);
static member Round : double * int * MidpointRounding -> double
Public Shared Function Round (x As Double, digits As Integer, mode As MidpointRounding) As Double
参数
- x
- Double
要舍入的值。
- digits
- Int32
应舍入到的小 x 数位数。
- mode
- MidpointRounding
应在其下舍入的 x 模式。
返回
使用x小数位数舍入digits到mode小数位数的结果。