Math Math Math Math Class

定义

为三角函数、对数函数和其他通用数学函数提供常数和静态方法。Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.

public ref class Math abstract sealed
public static class Math
type Math = class
Public Class Math
继承
MathMathMathMath

示例

下面的示例使用从多个数学和三角函数Math类来计算梯形内角。The following example uses several mathematical and trigonometric functions from the Math class to calculate the inner angles of a trapezoid.

/// <summary>
/// The following class represents simple functionality of the trapezoid.
/// </summary>
using namespace System;

public ref class MathTrapezoidSample
{
private:
   double m_longBase;
   double m_shortBase;
   double m_leftLeg;
   double m_rightLeg;

public:
   MathTrapezoidSample( double longbase, double shortbase, double leftLeg, double rightLeg )
   {
      m_longBase = Math::Abs( longbase );
      m_shortBase = Math::Abs( shortbase );
      m_leftLeg = Math::Abs( leftLeg );
      m_rightLeg = Math::Abs( rightLeg );
   }


private:
   double GetRightSmallBase()
   {
      return (Math::Pow( m_rightLeg, 2.0 ) - Math::Pow( m_leftLeg, 2.0 ) + Math::Pow( m_longBase, 2.0 ) + Math::Pow( m_shortBase, 2.0 ) - 2 * m_shortBase * m_longBase) / (2 * (m_longBase - m_shortBase));
   }


public:
   double GetHeight()
   {
      double x = GetRightSmallBase();
      return Math::Sqrt( Math::Pow( m_rightLeg, 2.0 ) - Math::Pow( x, 2.0 ) );
   }

   double GetSquare()
   {
      return GetHeight() * m_longBase / 2.0;
   }

   double GetLeftBaseRadianAngle()
   {
      double sinX = GetHeight() / m_leftLeg;
      return Math::Round( Math::Asin( sinX ), 2 );
   }

   double GetRightBaseRadianAngle()
   {
      double x = GetRightSmallBase();
      double cosX = (Math::Pow( m_rightLeg, 2.0 ) + Math::Pow( x, 2.0 ) - Math::Pow( GetHeight(), 2.0 )) / (2 * x * m_rightLeg);
      return Math::Round( Math::Acos( cosX ), 2 );
   }

   double GetLeftBaseDegreeAngle()
   {
      double x = GetLeftBaseRadianAngle() * 180 / Math::PI;
      return Math::Round( x, 2 );
   }

   double GetRightBaseDegreeAngle()
   {
      double x = GetRightBaseRadianAngle() * 180 / Math::PI;
      return Math::Round( x, 2 );
   }

};

int main()
{
   MathTrapezoidSample^ trpz = gcnew MathTrapezoidSample( 20.0,10.0,8.0,6.0 );
   Console::WriteLine( "The trapezoid's bases are 20.0 and 10.0, the trapezoid's legs are 8.0 and 6.0" );
   double h = trpz->GetHeight();
   Console::WriteLine( "Trapezoid height is: {0}", h.ToString() );
   double dxR = trpz->GetLeftBaseRadianAngle();
   Console::WriteLine( "Trapezoid left base angle is: {0} Radians", dxR.ToString() );
   double dyR = trpz->GetRightBaseRadianAngle();
   Console::WriteLine( "Trapezoid right base angle is: {0} Radians", dyR.ToString() );
   double dxD = trpz->GetLeftBaseDegreeAngle();
   Console::WriteLine( "Trapezoid left base angle is: {0} Degrees", dxD.ToString() );
   double dyD = trpz->GetRightBaseDegreeAngle();
   Console::WriteLine( "Trapezoid left base angle is: {0} Degrees", dyD.ToString() );
}
/// <summary>
/// The following class represents simple functionality of the trapezoid.
/// </summary>
using System;

namespace MathClassCS
{
	class MathTrapezoidSample
	{
		private double m_longBase;
		private double m_shortBase;
		private double m_leftLeg;
		private double m_rightLeg;

		public MathTrapezoidSample(double longbase, double shortbase, double leftLeg, double rightLeg)
		{
			m_longBase = Math.Abs(longbase);
			m_shortBase = Math.Abs(shortbase);
			m_leftLeg = Math.Abs(leftLeg);
			m_rightLeg = Math.Abs(rightLeg);
		}

		private double GetRightSmallBase()
		{
			return (Math.Pow(m_rightLeg,2.0) - Math.Pow(m_leftLeg,2.0) + Math.Pow(m_longBase,2.0) + Math.Pow(m_shortBase,2.0) - 2* m_shortBase * m_longBase)/ (2*(m_longBase - m_shortBase));
		}

		public double GetHeight()
		{
			double x = GetRightSmallBase();
			return Math.Sqrt(Math.Pow(m_rightLeg,2.0) - Math.Pow(x,2.0));
		}

		public double GetSquare()
		{
			return GetHeight() * m_longBase / 2.0;
		}

		public double GetLeftBaseRadianAngle()
		{
			double sinX = GetHeight()/m_leftLeg;
			return Math.Round(Math.Asin(sinX),2);
		}

		public double GetRightBaseRadianAngle()
		{
			double x = GetRightSmallBase();
			double cosX = (Math.Pow(m_rightLeg,2.0) + Math.Pow(x,2.0) - Math.Pow(GetHeight(),2.0))/(2*x*m_rightLeg);
			return Math.Round(Math.Acos(cosX),2);
		}

		public double GetLeftBaseDegreeAngle()
		{
			double x = GetLeftBaseRadianAngle() * 180/ Math.PI;
			return Math.Round(x,2);
		}

		public double GetRightBaseDegreeAngle()
		{
			double x = GetRightBaseRadianAngle() * 180/ Math.PI;
			return Math.Round(x,2);
		}

		static void Main(string[] args)
		{
			MathTrapezoidSample trpz = new MathTrapezoidSample(20.0, 10.0, 8.0, 6.0);
			Console.WriteLine("The trapezoid's bases are 20.0 and 10.0, the trapezoid's legs are 8.0 and 6.0");
			double h = trpz.GetHeight();
			Console.WriteLine("Trapezoid height is: " + h.ToString());
			double dxR = trpz.GetLeftBaseRadianAngle();
			Console.WriteLine("Trapezoid left base angle is: " + dxR.ToString() + " Radians");
			double dyR = trpz.GetRightBaseRadianAngle();
			Console.WriteLine("Trapezoid right base angle is: " + dyR.ToString() + " Radians");
			double dxD = trpz.GetLeftBaseDegreeAngle();
			Console.WriteLine("Trapezoid left base angle is: " + dxD.ToString() + " Degrees");
			double dyD = trpz.GetRightBaseDegreeAngle();
			Console.WriteLine("Trapezoid left base angle is: " + dyD.ToString() + " Degrees");
		}
	}
}
'The following class represents simple functionality of the trapezoid.
Class MathTrapezoidSample

    Private m_longBase As Double
    Private m_shortBase As Double
    Private m_leftLeg As Double
    Private m_rightLeg As Double

    Public Sub New(ByVal longbase As Double, ByVal shortbase As Double, ByVal leftLeg As Double, ByVal rightLeg As Double)
        m_longBase = Math.Abs(longbase)
        m_shortBase = Math.Abs(shortbase)
        m_leftLeg = Math.Abs(leftLeg)
        m_rightLeg = Math.Abs(rightLeg)
    End Sub

    Private Function GetRightSmallBase() As Double
        GetRightSmallBase = (Math.Pow(m_rightLeg, 2) - Math.Pow(m_leftLeg, 2) + Math.Pow(m_longBase, 2) + Math.Pow(m_shortBase, 2) - 2 * m_shortBase * m_longBase) / (2 * (m_longBase - m_shortBase))
    End Function

    Public Function GetHeight() As Double
        Dim x As Double = GetRightSmallBase()
        GetHeight = Math.Sqrt(Math.Pow(m_rightLeg, 2) - Math.Pow(x, 2))
    End Function

    Public Function GetSquare() As Double
        GetSquare = GetHeight() * m_longBase / 2
    End Function

    Public Function GetLeftBaseRadianAngle() As Double
        Dim sinX As Double = GetHeight() / m_leftLeg
        GetLeftBaseRadianAngle = Math.Round(Math.Asin(sinX), 2)
    End Function

    Public Function GetRightBaseRadianAngle() As Double
        Dim x As Double = GetRightSmallBase()
        Dim cosX As Double = (Math.Pow(m_rightLeg, 2) + Math.Pow(x, 2) - Math.Pow(GetHeight(), 2)) / (2 * x * m_rightLeg)
        GetRightBaseRadianAngle = Math.Round(Math.Acos(cosX), 2)
    End Function

    Public Function GetLeftBaseDegreeAngle() As Double
        Dim x As Double = GetLeftBaseRadianAngle() * 180 / Math.PI
        GetLeftBaseDegreeAngle = Math.Round(x, 2)
    End Function

    Public Function GetRightBaseDegreeAngle() As Double
        Dim x As Double = GetRightBaseRadianAngle() * 180 / Math.PI
        GetRightBaseDegreeAngle = Math.Round(x, 2)
    End Function

    Public Shared Sub Main()
        Dim trpz As MathTrapezoidSample = New MathTrapezoidSample(20, 10, 8, 6)
        Console.WriteLine("The trapezoid's bases are 20.0 and 10.0, the trapezoid's legs are 8.0 and 6.0")
        Dim h As Double = trpz.GetHeight()
        Console.WriteLine("Trapezoid height is: " + h.ToString())
        Dim dxR As Double = trpz.GetLeftBaseRadianAngle()
        Console.WriteLine("Trapezoid left base angle is: " + dxR.ToString() + " Radians")
        Dim dyR As Double = trpz.GetRightBaseRadianAngle()
        Console.WriteLine("Trapezoid right base angle is: " + dyR.ToString() + " Radians")
        Dim dxD As Double = trpz.GetLeftBaseDegreeAngle()
        Console.WriteLine("Trapezoid left base angle is: " + dxD.ToString() + " Degrees")
        Dim dyD As Double = trpz.GetRightBaseDegreeAngle()
        Console.WriteLine("Trapezoid left base angle is: " + dyD.ToString() + " Degrees")
    End Sub
End Class

字段

E E E E

表示自然对数的底,它由常数 e 指定。Represents the natural logarithmic base, specified by the constant, e.

PI PI PI PI

表示圆的周长与其直径的比值,由常数 π 指定。Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.

方法

Abs(Decimal) Abs(Decimal) Abs(Decimal) Abs(Decimal)

返回 Decimal 数字的绝对值。Returns the absolute value of a Decimal number.

Abs(Double) Abs(Double) Abs(Double) Abs(Double)

返回双精度浮点数字的绝对值。Returns the absolute value of a double-precision floating-point number.

Abs(Int16) Abs(Int16) Abs(Int16) Abs(Int16)

返回 16 位有符号整数的绝对值。Returns the absolute value of a 16-bit signed integer.

Abs(Int32) Abs(Int32) Abs(Int32) Abs(Int32)

返回 32 位有符号整数的绝对值。Returns the absolute value of a 32-bit signed integer.

Abs(Int64) Abs(Int64) Abs(Int64) Abs(Int64)

返回 64 位有符号整数的绝对值。Returns the absolute value of a 64-bit signed integer.

Abs(SByte) Abs(SByte) Abs(SByte) Abs(SByte)

返回 8 位有符号整数的绝对值。Returns the absolute value of an 8-bit signed integer.

Abs(Single) Abs(Single) Abs(Single) Abs(Single)

返回单精度浮点数字的绝对值。Returns the absolute value of a single-precision floating-point number.

Acos(Double) Acos(Double) Acos(Double) Acos(Double)

返回余弦值为指定数字的角度。Returns the angle whose cosine is the specified number.

Acosh(Double) Acosh(Double) Acosh(Double) Acosh(Double)

返回双曲余弦值为指定数字的角度。Returns the angle whose hyperbolic cosine is the specified number.

Asin(Double) Asin(Double) Asin(Double) Asin(Double)

返回正弦值为指定数字的角度。Returns the angle whose sine is the specified number.

Asinh(Double) Asinh(Double) Asinh(Double) Asinh(Double)

返回双曲正弦值为指定数字的角度。Returns the angle whose hyperbolic sine is the specified number.

Atan(Double) Atan(Double) Atan(Double) Atan(Double)

返回正切值为指定数字的角度。Returns the angle whose tangent is the specified number.

Atan2(Double, Double) Atan2(Double, Double) Atan2(Double, Double) Atan2(Double, Double)

返回正切值为两个指定数字的商的角度。Returns the angle whose tangent is the quotient of two specified numbers.

Atanh(Double) Atanh(Double) Atanh(Double) Atanh(Double)

返回双曲正切值为指定数字的角度。Returns the angle whose hyperbolic tangent is the specified number.

BigMul(Int32, Int32) BigMul(Int32, Int32) BigMul(Int32, Int32) BigMul(Int32, Int32)

生成两个 32 位数字的完整乘积。Produces the full product of two 32-bit numbers.

BitDecrement(Double) BitDecrement(Double) BitDecrement(Double) BitDecrement(Double)

返回小于 x 的下一个最小值。Returns the next smallest value that compares less than x.

BitIncrement(Double) BitIncrement(Double) BitIncrement(Double) BitIncrement(Double)

返回大于 x 的下一个最大值。Returns the next largest value that compares greater than x.

Cbrt(Double) Cbrt(Double) Cbrt(Double) Cbrt(Double)

返回指定数字的立方根。Returns the cube root of a specified number.

Ceiling(Decimal) Ceiling(Decimal) Ceiling(Decimal) Ceiling(Decimal)

返回大于或等于指定的十进制数的最小整数值。Returns the smallest integral value that is greater than or equal to the specified decimal number.

Ceiling(Double) Ceiling(Double) Ceiling(Double) Ceiling(Double)

返回大于或等于指定的双精度浮点数的最小整数值。Returns the smallest integral value that is greater than or equal to the specified double-precision floating-point number.

Clamp(UInt64, UInt64, UInt64) Clamp(UInt64, UInt64, UInt64) Clamp(UInt64, UInt64, UInt64) Clamp(UInt64, UInt64, UInt64)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(UInt32, UInt32, UInt32) Clamp(UInt32, UInt32, UInt32) Clamp(UInt32, UInt32, UInt32) Clamp(UInt32, UInt32, UInt32)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(UInt16, UInt16, UInt16) Clamp(UInt16, UInt16, UInt16) Clamp(UInt16, UInt16, UInt16) Clamp(UInt16, UInt16, UInt16)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(Single, Single, Single) Clamp(Single, Single, Single) Clamp(Single, Single, Single) Clamp(Single, Single, Single)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(SByte, SByte, SByte) Clamp(SByte, SByte, SByte) Clamp(SByte, SByte, SByte) Clamp(SByte, SByte, SByte)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(Int64, Int64, Int64) Clamp(Int64, Int64, Int64) Clamp(Int64, Int64, Int64) Clamp(Int64, Int64, Int64)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(Int32, Int32, Int32) Clamp(Int32, Int32, Int32) Clamp(Int32, Int32, Int32) Clamp(Int32, Int32, Int32)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(Int16, Int16, Int16) Clamp(Int16, Int16, Int16) Clamp(Int16, Int16, Int16) Clamp(Int16, Int16, Int16)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(Double, Double, Double) Clamp(Double, Double, Double) Clamp(Double, Double, Double) Clamp(Double, Double, Double)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(Decimal, Decimal, Decimal) Clamp(Decimal, Decimal, Decimal) Clamp(Decimal, Decimal, Decimal) Clamp(Decimal, Decimal, Decimal)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

Clamp(Byte, Byte, Byte) Clamp(Byte, Byte, Byte) Clamp(Byte, Byte, Byte) Clamp(Byte, Byte, Byte)

返回限制在 minmax 范围内(含首尾)的 valueReturns value clamped to the inclusive range of min and max.

CopySign(Double, Double) CopySign(Double, Double) CopySign(Double, Double) CopySign(Double, Double)

返回一个值,它具有 x 的大小和 y 的符号。Returns a value with the magnitude of x and the sign of y.

Cos(Double) Cos(Double) Cos(Double) Cos(Double)

返回指定角度的余弦值。Returns the cosine of the specified angle.

Cosh(Double) Cosh(Double) Cosh(Double) Cosh(Double)

返回指定角度的双曲余弦值。Returns the hyperbolic cosine of the specified angle.

DivRem(Int32, Int32, Int32) DivRem(Int32, Int32, Int32) DivRem(Int32, Int32, Int32) DivRem(Int32, Int32, Int32)

计算两个 32 位有符号整数的商,并通过输出参数返回余数。Calculates the quotient of two 32-bit signed integers and also returns the remainder in an output parameter.

DivRem(Int64, Int64, Int64) DivRem(Int64, Int64, Int64) DivRem(Int64, Int64, Int64) DivRem(Int64, Int64, Int64)

计算两个 64 位有符号整数的商,并通过输出参数返回余数。Calculates the quotient of two 64-bit signed integers and also returns the remainder in an output parameter.

Exp(Double) Exp(Double) Exp(Double) Exp(Double)

返回 e 的指定次幂。Returns e raised to the specified power.

Floor(Double) Floor(Double) Floor(Double) Floor(Double)

返回小于或等于指定双精度浮点数的最大整数值。Returns the largest integral value less than or equal to the specified double-precision floating-point number.

Floor(Decimal) Floor(Decimal) Floor(Decimal) Floor(Decimal)

返回小于或等于指定小数的最大整数值。Returns the largest integral value less than or equal to the specified decimal number.

FusedMultiplyAdd(Double, Double, Double) FusedMultiplyAdd(Double, Double, Double) FusedMultiplyAdd(Double, Double, Double) FusedMultiplyAdd(Double, Double, Double)

返回 (x * y) + z,舍入为一个三元运算。Returns (x * y) + z, rounded as one ternary operation.

IEEERemainder(Double, Double) IEEERemainder(Double, Double) IEEERemainder(Double, Double) IEEERemainder(Double, Double)

返回一指定数字被另一指定数字相除的余数。Returns the remainder resulting from the division of a specified number by another specified number.

ILogB(Double) ILogB(Double) ILogB(Double) ILogB(Double)

返回指定数字以 2 为底的整数对数。Returns the base 2 integer logarithm of a specified number.

Log(Double) Log(Double) Log(Double) Log(Double)

返回指定数字的自然对数(底为 e)。Returns the natural (base e) logarithm of a specified number.

Log(Double, Double) Log(Double, Double) Log(Double, Double) Log(Double, Double)

返回指定数字在使用指定底时的对数。Returns the logarithm of a specified number in a specified base.

Log10(Double) Log10(Double) Log10(Double) Log10(Double)

返回指定数字以 10 为底的对数。Returns the base 10 logarithm of a specified number.

Log2(Double) Log2(Double) Log2(Double) Log2(Double)

返回指定数字以 2 为底的对数。Returns the base 2 logarithm of a specified number.

Max(UInt64, UInt64) Max(UInt64, UInt64) Max(UInt64, UInt64) Max(UInt64, UInt64)

返回两个 64 位无符号整数中较大的一个。Returns the larger of two 64-bit unsigned integers.

Max(UInt32, UInt32) Max(UInt32, UInt32) Max(UInt32, UInt32) Max(UInt32, UInt32)

返回两个 32 位无符号整数中较大的一个。Returns the larger of two 32-bit unsigned integers.

Max(UInt16, UInt16) Max(UInt16, UInt16) Max(UInt16, UInt16) Max(UInt16, UInt16)

返回两个 16 位无符号整数中较大的一个。Returns the larger of two 16-bit unsigned integers.

Max(Single, Single) Max(Single, Single) Max(Single, Single) Max(Single, Single)

返回两个单精度浮点数字中较大的一个。Returns the larger of two single-precision floating-point numbers.

Max(SByte, SByte) Max(SByte, SByte) Max(SByte, SByte) Max(SByte, SByte)

返回两个 8 位有符号的整数中较大的一个。Returns the larger of two 8-bit signed integers.

Max(Byte, Byte) Max(Byte, Byte) Max(Byte, Byte) Max(Byte, Byte)

返回两个 8 位无符号整数中较大的一个。Returns the larger of two 8-bit unsigned integers.

Max(Int32, Int32) Max(Int32, Int32) Max(Int32, Int32) Max(Int32, Int32)

返回两个 32 位有符号的整数中较大的一个。Returns the larger of two 32-bit signed integers.

Max(Int16, Int16) Max(Int16, Int16) Max(Int16, Int16) Max(Int16, Int16)

返回两个 16 位有符号的整数中较大的一个。Returns the larger of two 16-bit signed integers.

Max(Double, Double) Max(Double, Double) Max(Double, Double) Max(Double, Double)

返回两个双精度浮点数字中较大的一个。Returns the larger of two double-precision floating-point numbers.

Max(Decimal, Decimal) Max(Decimal, Decimal) Max(Decimal, Decimal) Max(Decimal, Decimal)

返回两个十进制数中较大的一个。Returns the larger of two decimal numbers.

Max(Int64, Int64) Max(Int64, Int64) Max(Int64, Int64) Max(Int64, Int64)

返回两个 64 位有符号的整数中较大的一个。Returns the larger of two 64-bit signed integers.

MaxMagnitude(Double, Double) MaxMagnitude(Double, Double) MaxMagnitude(Double, Double) MaxMagnitude(Double, Double)

返回两个双精度浮点数字中的较大值。Returns the larger magnitude of two double-precision floating-point numbers.

Min(UInt64, UInt64) Min(UInt64, UInt64) Min(UInt64, UInt64) Min(UInt64, UInt64)

返回两个 64 位无符号整数中较小的一个。Returns the smaller of two 64-bit unsigned integers.

Min(UInt32, UInt32) Min(UInt32, UInt32) Min(UInt32, UInt32) Min(UInt32, UInt32)

返回两个 32 位无符号整数中较小的一个。Returns the smaller of two 32-bit unsigned integers.

Min(UInt16, UInt16) Min(UInt16, UInt16) Min(UInt16, UInt16) Min(UInt16, UInt16)

返回两个 16 位无符号整数中较小的一个。Returns the smaller of two 16-bit unsigned integers.

Min(Single, Single) Min(Single, Single) Min(Single, Single) Min(Single, Single)

返回两个单精度浮点数字中较小的一个。Returns the smaller of two single-precision floating-point numbers.

Min(SByte, SByte) Min(SByte, SByte) Min(SByte, SByte) Min(SByte, SByte)

返回两个 8 位有符号整数中较小的一个。Returns the smaller of two 8-bit signed integers.

Min(Int64, Int64) Min(Int64, Int64) Min(Int64, Int64) Min(Int64, Int64)

返回两个 64 位有符号整数中较小的一个。Returns the smaller of two 64-bit signed integers.

Min(Int32, Int32) Min(Int32, Int32) Min(Int32, Int32) Min(Int32, Int32)

返回两个 32 位有符号整数中较小的一个。Returns the smaller of two 32-bit signed integers.

Min(Int16, Int16) Min(Int16, Int16) Min(Int16, Int16) Min(Int16, Int16)

返回两个 16 位有符号整数中较小的一个。Returns the smaller of two 16-bit signed integers.

Min(Double, Double) Min(Double, Double) Min(Double, Double) Min(Double, Double)

返回两个双精度浮点数字中较小的一个。Returns the smaller of two double-precision floating-point numbers.

Min(Decimal, Decimal) Min(Decimal, Decimal) Min(Decimal, Decimal) Min(Decimal, Decimal)

返回两个十进制数中较小的一个。Returns the smaller of two decimal numbers.

Min(Byte, Byte) Min(Byte, Byte) Min(Byte, Byte) Min(Byte, Byte)

返回两个 8 位无符号整数中较小的一个。Returns the smaller of two 8-bit unsigned integers.

MinMagnitude(Double, Double) MinMagnitude(Double, Double) MinMagnitude(Double, Double) MinMagnitude(Double, Double)

返回两个双精度浮点数字中的较小值。Returns the smaller magnitude of two double-precision floating-point numbers.

Pow(Double, Double) Pow(Double, Double) Pow(Double, Double) Pow(Double, Double)

返回指定数字的指定次幂。Returns a specified number raised to the specified power.

Round(Decimal, Int32, MidpointRounding) Round(Decimal, Int32, MidpointRounding) Round(Decimal, Int32, MidpointRounding) Round(Decimal, Int32, MidpointRounding)

将小数值舍入到指定数量的小数位,并为中点值使用指定的舍入规则。Rounds a decimal value to a specified number of fractional digits, and uses the specified rounding convention for midpoint values.

Round(Double, Int32, MidpointRounding) Round(Double, Int32, MidpointRounding) Round(Double, Int32, MidpointRounding) Round(Double, Int32, MidpointRounding)

将双精度浮点值舍入到指定数量的小数位,并为中点值使用指定的舍入规则。Rounds a double-precision floating-point value to a specified number of fractional digits, and uses the specified rounding convention for midpoint values.

Round(Double, MidpointRounding) Round(Double, MidpointRounding) Round(Double, MidpointRounding) Round(Double, MidpointRounding)

将双精度浮点值舍入到最接近的整数,并为中点值使用指定的舍入约定。Rounds a double-precision floating-point value to the nearest integer, and uses the specified rounding convention for midpoint values.

Round(Double, Int32) Round(Double, Int32) Round(Double, Int32) Round(Double, Int32)

将双精度浮点值舍入到指定数量的小数位,并将中点值舍入到最接近的偶数。Rounds a double-precision floating-point value to a specified number of fractional digits, and rounds midpoint values to the nearest even number.

Round(Double) Round(Double) Round(Double) Round(Double)

将双精度浮点值舍入到最接近的整数值,并将中点值舍入到最接近的偶数。Rounds a double-precision floating-point value to the nearest integral value, and rounds midpoint values to the nearest even number.

Round(Decimal, Int32) Round(Decimal, Int32) Round(Decimal, Int32) Round(Decimal, Int32)

将小数值舍入到指定数量的小数位,并将中点值舍入到最接近的偶数。Rounds a decimal value to a specified number of fractional digits, and rounds midpoint values to the nearest even number.

Round(Decimal) Round(Decimal) Round(Decimal) Round(Decimal)

将小数值舍入到最接近的整数值,并将中点值舍入到最接近的偶数。Rounds a decimal value to the nearest integral value, and rounds midpoint values to the nearest even number.

Round(Decimal, MidpointRounding) Round(Decimal, MidpointRounding) Round(Decimal, MidpointRounding) Round(Decimal, MidpointRounding)

将小数值舍入到最接近的整数,并为中点值使用指定的舍入规则。Rounds a decimal value to the nearest integer, and uses the specified rounding convention for midpoint values.

ScaleB(Double, Int32) ScaleB(Double, Int32) ScaleB(Double, Int32) ScaleB(Double, Int32)

返回有效计算的 x * 2^n。Returns x * 2^n computed efficiently.

Sign(Single) Sign(Single) Sign(Single) Sign(Single)

返回一个整数,该整数表示单精度浮点数字的符号。Returns an integer that indicates the sign of a single-precision floating-point number.

Sign(SByte) Sign(SByte) Sign(SByte) Sign(SByte)

返回一个整数,该整数指示 8 位带符号整数的符号。Returns an integer that indicates the sign of an 8-bit signed integer.

Sign(Int32) Sign(Int32) Sign(Int32) Sign(Int32)

返回表示 32 位带符号整数的整数。Returns an integer that indicates the sign of a 32-bit signed integer.

Sign(Int64) Sign(Int64) Sign(Int64) Sign(Int64)

返回一个整数,该整数指示 64 位带符号整数的符号。Returns an integer that indicates the sign of a 64-bit signed integer.

Sign(Double) Sign(Double) Sign(Double) Sign(Double)

返回一个整数,该整数表示双精度浮点数字的符号。Returns an integer that indicates the sign of a double-precision floating-point number.

Sign(Decimal) Sign(Decimal) Sign(Decimal) Sign(Decimal)

返回表示十进制数符号的整数。Returns an integer that indicates the sign of a decimal number.

Sign(Int16) Sign(Int16) Sign(Int16) Sign(Int16)

返回表示 16 位带符号整数的整数。Returns an integer that indicates the sign of a 16-bit signed integer.

Sin(Double) Sin(Double) Sin(Double) Sin(Double)

返回指定角度的正弦值。Returns the sine of the specified angle.

Sinh(Double) Sinh(Double) Sinh(Double) Sinh(Double)

返回指定角度的双曲正弦值。Returns the hyperbolic sine of the specified angle.

Sqrt(Double) Sqrt(Double) Sqrt(Double) Sqrt(Double)

返回指定数字的平方根。Returns the square root of a specified number.

Tan(Double) Tan(Double) Tan(Double) Tan(Double)

返回指定角度的正切值。Returns the tangent of the specified angle.

Tanh(Double) Tanh(Double) Tanh(Double) Tanh(Double)

返回指定角度的双曲正切值。Returns the hyperbolic tangent of the specified angle.

Truncate(Decimal) Truncate(Decimal) Truncate(Decimal) Truncate(Decimal)

计算一个数字的整数部分。Calculates the integral part of a specified decimal number.

Truncate(Double) Truncate(Double) Truncate(Double) Truncate(Double)

计算指定双精度浮点数的整数部分。Calculates the integral part of a specified double-precision floating-point number.

适用于