語言

Double.Round 方法

定義

多載

名稱 Description
Round(Double)

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

Round(Double, Int32)

使用預設的四捨五入模式()ToEven將數值四捨五入至指定數量的分數位數。

Round(Double, MidpointRounding)

使用指定的四捨五入模式將值捨入至最近的整數。

Round(Double, Int32, MidpointRounding)

使用預設的四捨五入模式()ToEven將數值四捨五入至指定數量的分數位數。

Round(Double)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
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)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
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 整數位數。

傳回

這是使用預設四捨五入模式將整數xdigits到小數位數的結果。

實作

適用於

Round(Double, MidpointRounding)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
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)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
Double.cs
來源:
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將整數為 digitsmode 的結果。

實作

適用於