mscorlib(4.0.0.0) API with additions
|
Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.To browse the .NET Framework source code for this type, see the Reference Source. More...
Public Member Functions | |
static double | Acos (double d) |
Returns the angle whose cosine is the specified number. More... | |
static double | Asin (double d) |
Returns the angle whose sine is the specified number. More... | |
static double | Atan (double d) |
Returns the angle whose tangent is the specified number. More... | |
static double | Atan2 (double y, double x) |
Returns the angle whose tangent is the quotient of two specified numbers. More... | |
static double | Ceiling (double a) |
Returns the smallest integral value that is greater than or equal to the specified double-precision floating-point number. More... | |
static double | Cos (double d) |
Returns the cosine of the specified angle. More... | |
static double | Cosh (double value) |
Returns the hyperbolic cosine of the specified angle. More... | |
static double | Floor (double d) |
Returns the largest integer less than or equal to the specified double-precision floating-point number. More... | |
static double | Sin (double a) |
Returns the sine of the specified angle. More... | |
static double | Tan (double a) |
Returns the tangent of the specified angle. More... | |
static double | Sinh (double value) |
Returns the hyperbolic sine of the specified angle. More... | |
static double | Tanh (double value) |
Returns the hyperbolic tangent of the specified angle. More... | |
static double | Round (double a) |
Rounds a double-precision floating-point value to the nearest integral value. More... | |
static double | Sqrt (double d) |
Returns the square root of a specified number. More... | |
static double | Log (double d) |
Returns the natural (base e ) logarithm of a specified number. More... | |
static double | Log10 (double d) |
Returns the base 10 logarithm of a specified number. More... | |
static double | Exp (double d) |
Returns e raised to the specified power. More... | |
static double | Pow (double x, double y) |
Returns a specified number raised to the specified power. More... | |
static float | Abs (float value) |
Returns the absolute value of a single-precision floating-point number. More... | |
static double | Abs (double value) |
Returns the absolute value of a double-precision floating-point number. More... | |
Static Public Member Functions | |
static decimal | Ceiling (decimal d) |
Returns the smallest integral value that is greater than or equal to the specified decimal number. More... | |
static decimal | Floor (decimal d) |
Returns the largest integer less than or equal to the specified decimal number. More... | |
static double | Round (double value, int digits) |
Rounds a double-precision floating-point value to a specified number of fractional digits. More... | |
static double | Round (double value, MidpointRounding mode) |
Rounds a double-precision floating-point value to the nearest integer. A parameter specifies how to round the value if it is midway between two numbers. More... | |
static double | Round (double value, int digits, MidpointRounding mode) |
Rounds a double-precision floating-point value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two numbers. More... | |
static decimal | Round (decimal d) |
Rounds a decimal value to the nearest integral value. More... | |
static decimal | Round (decimal d, int decimals) |
Rounds a decimal value to a specified number of fractional digits. More... | |
static decimal | Round (decimal d, MidpointRounding mode) |
Rounds a decimal value to the nearest integer. A parameter specifies how to round the value if it is midway between two numbers. More... | |
static decimal | Round (decimal d, int decimals, MidpointRounding mode) |
Rounds a decimal value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two numbers. More... | |
static decimal | Truncate (decimal d) |
Calculates the integral part of a specified decimal number. More... | |
static double | Truncate (double d) |
Calculates the integral part of a specified double-precision floating-point number. More... | |
static double | IEEERemainder (double x, double y) |
Returns the remainder resulting from the division of a specified number by another specified number. More... | |
static sbyte | Abs (sbyte value) |
Returns the absolute value of an 8-bit signed integer. More... | |
static short | Abs (short value) |
Returns the absolute value of a 16-bit signed integer. More... | |
static int | Abs (int value) |
Returns the absolute value of a 32-bit signed integer. More... | |
static long | Abs (long value) |
Returns the absolute value of a 64-bit signed integer. More... | |
static decimal | Abs (decimal value) |
Returns the absolute value of a T:System.Decimal number. More... | |
static sbyte | Max (sbyte val1, sbyte val2) |
Returns the larger of two 8-bit signed integers. More... | |
static byte | Max (byte val1, byte val2) |
Returns the larger of two 8-bit unsigned integers. More... | |
static short | Max (short val1, short val2) |
Returns the larger of two 16-bit signed integers. More... | |
static ushort | Max (ushort val1, ushort val2) |
Returns the larger of two 16-bit unsigned integers. More... | |
static int | Max (int val1, int val2) |
Returns the larger of two 32-bit signed integers. More... | |
static uint | Max (uint val1, uint val2) |
Returns the larger of two 32-bit unsigned integers. More... | |
static long | Max (long val1, long val2) |
Returns the larger of two 64-bit signed integers. More... | |
static ulong | Max (ulong val1, ulong val2) |
Returns the larger of two 64-bit unsigned integers. More... | |
static float | Max (float val1, float val2) |
Returns the larger of two single-precision floating-point numbers. More... | |
static double | Max (double val1, double val2) |
Returns the larger of two double-precision floating-point numbers. More... | |
static decimal | Max (decimal val1, decimal val2) |
Returns the larger of two decimal numbers. More... | |
static sbyte | Min (sbyte val1, sbyte val2) |
Returns the smaller of two 8-bit signed integers. More... | |
static byte | Min (byte val1, byte val2) |
Returns the smaller of two 8-bit unsigned integers. More... | |
static short | Min (short val1, short val2) |
Returns the smaller of two 16-bit signed integers. More... | |
static ushort | Min (ushort val1, ushort val2) |
Returns the smaller of two 16-bit unsigned integers. More... | |
static int | Min (int val1, int val2) |
Returns the smaller of two 32-bit signed integers. More... | |
static uint | Min (uint val1, uint val2) |
Returns the smaller of two 32-bit unsigned integers. More... | |
static long | Min (long val1, long val2) |
Returns the smaller of two 64-bit signed integers. More... | |
static ulong | Min (ulong val1, ulong val2) |
Returns the smaller of two 64-bit unsigned integers. More... | |
static float | Min (float val1, float val2) |
Returns the smaller of two single-precision floating-point numbers. More... | |
static double | Min (double val1, double val2) |
Returns the smaller of two double-precision floating-point numbers. More... | |
static decimal | Min (decimal val1, decimal val2) |
Returns the smaller of two decimal numbers. More... | |
static double | Log (double a, double newBase) |
Returns the logarithm of a specified number in a specified base. More... | |
static int | Sign (sbyte value) |
Returns an integer that indicates the sign of an 8-bit signed integer. More... | |
static int | Sign (short value) |
Returns an integer that indicates the sign of a 16-bit signed integer. More... | |
static int | Sign (int value) |
Returns an integer that indicates the sign of a 32-bit signed integer. More... | |
static int | Sign (long value) |
Returns an integer that indicates the sign of a 64-bit signed integer. More... | |
static int | Sign (float value) |
Returns an integer that indicates the sign of a single-precision floating-point number. More... | |
static int | Sign (double value) |
Returns an integer that indicates the sign of a double-precision floating-point number. More... | |
static int | Sign (decimal value) |
Returns an integer that indicates the sign of a decimal number. More... | |
static long | BigMul (int a, int b) |
Produces the full product of two 32-bit numbers. More... | |
static int | DivRem (int a, int b, out int result) |
Calculates the quotient of two 32-bit signed integers and also returns the remainder in an output parameter. More... | |
static long | DivRem (long a, long b, out long result) |
Calculates the quotient of two 64-bit signed integers and also returns the remainder in an output parameter. More... | |
Public Attributes | |
const double | PI = 3.1415926535897931 |
Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π. More... | |
const double | E = 2.7182818284590451 |
Represents the natural logarithmic base, specified by the constant, e . More... | |
Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.To browse the .NET Framework source code for this type, see the Reference Source.
|
static |
Returns the absolute value of an 8-bit signed integer.
value | A number that is greater than F:System.SByte.MinValue, but less than or equal to F:System.SByte.MaxValue. |
T:System.OverflowException | value equals F:System.SByte.MinValue. |
|
static |
Returns the absolute value of a 16-bit signed integer.
value | A number that is greater than F:System.Int16.MinValue, but less than or equal to F:System.Int16.MaxValue. |
T:System.OverflowException | value equals F:System.Int16.MinValue. |
|
static |
Returns the absolute value of a 32-bit signed integer.
value | A number that is greater than F:System.Int32.MinValue, but less than or equal to F:System.Int32.MaxValue. |
T:System.OverflowException | value equals F:System.Int32.MinValue. |
|
static |
Returns the absolute value of a 64-bit signed integer.
value | A number that is greater than F:System.Int64.MinValue, but less than or equal to F:System.Int64.MaxValue. |
T:System.OverflowException | value equals F:System.Int64.MinValue. |
static float System.Math.Abs | ( | float | value | ) |
Returns the absolute value of a single-precision floating-point number.
value | A number that is greater than or equal to F:System.Single.MinValue, but less than or equal to F:System.Single.MaxValue. |
static double System.Math.Abs | ( | double | value | ) |
Returns the absolute value of a double-precision floating-point number.
value | A number that is greater than or equal to F:System.Double.MinValue, but less than or equal to F:System.Double.MaxValue. |
|
static |
Returns the absolute value of a T:System.Decimal number.
value | A number that is greater than or equal to F:System.Decimal.MinValue, but less than or equal to F:System.Decimal.MaxValue. |
static double System.Math.Acos | ( | double | d | ) |
Returns the angle whose cosine is the specified number.
d | A number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1. |
static double System.Math.Asin | ( | double | d | ) |
Returns the angle whose sine is the specified number.
d | A number representing a sine, where d must be greater than or equal to -1, but less than or equal to 1. |
static double System.Math.Atan | ( | double | d | ) |
Returns the angle whose tangent is the specified number.
d | A number representing a tangent. |
static double System.Math.Atan2 | ( | double | y, |
double | x | ||
) |
Returns the angle whose tangent is the quotient of two specified numbers.
y | The y coordinate of a point. |
x | The x coordinate of a point. |
|
static |
|
static |
Returns the smallest integral value that is greater than or equal to the specified decimal number.
d | A decimal number. |
static double System.Math.Ceiling | ( | double | a | ) |
Returns the smallest integral value that is greater than or equal to the specified double-precision floating-point number.
a | A double-precision floating-point number. |
static double System.Math.Cos | ( | double | d | ) |
Returns the cosine of the specified angle.
d | An angle, measured in radians. |
static double System.Math.Cosh | ( | double | value | ) |
Returns the hyperbolic cosine of the specified angle.
value | An angle, measured in radians. |
|
static |
Calculates the quotient of two 32-bit signed integers and also returns the remainder in an output parameter.
a | The dividend. |
b | The divisor. |
result | The remainder. |
T:System.DivideByZeroException | b is zero. |
|
static |
Calculates the quotient of two 64-bit signed integers and also returns the remainder in an output parameter.
a | The dividend. |
b | The divisor. |
result | The remainder. |
T:System.DivideByZeroException | b is zero. |
static double System.Math.Exp | ( | double | d | ) |
Returns e
raised to the specified power.
d | A number specifying a power. |
e
raised to the power d . If d equals F:System.Double.NaN or F:System.Double.PositiveInfinity, that value is returned. If d equals F:System.Double.NegativeInfinity, 0 is returned.
|
static |
static double System.Math.Floor | ( | double | d | ) |
Returns the largest integer less than or equal to the specified double-precision floating-point number.
d | A double-precision floating-point number. |
|
static |
Returns the remainder resulting from the division of a specified number by another specified number.
x | A dividend. |
y | A divisor. |
static double System.Math.Log | ( | double | d | ) |
Returns the natural (base e
) logarithm of a specified number.
d | The number whose logarithm is to be found. |
|
static |
Returns the logarithm of a specified number in a specified base.
a | The number whose logarithm is to be found. |
newBase | The base of the logarithm. |
One of the values in the following table. (+Infinity denotes F:System.Double.PositiveInfinity, -Infinity denotes F:System.Double.NegativeInfinity, and NaN denotes F:System.Double.NaN.) a
newBase Return value a > 0(0 <newBase < 1) -or-(newBase > 1)lognewBase(a) a < 0(any value)NaN(any value) newBase < 0NaN a != 1 newBase = 0NaN a != 1 newBase = +InfinityNaN a = NaN(any value)NaN(any value) newBase = NaNNaN(any value) newBase = 1NaN a = 00 <newBase < 1 +Infinity a = 0 newBase > 1-Infinity a = +Infinity0 <newBase < 1-Infinity a = +Infinity newBase > 1+Infinity a = 1 newBase = 00 a = 1 newBase = +Infinity0
static double System.Math.Log10 | ( | double | d | ) |
Returns the base 10 logarithm of a specified number.
d | A number whose logarithm is to be found. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Returns the larger of two single-precision floating-point numbers.
val1 | The first of two single-precision floating-point numbers to compare. |
val2 | The second of two single-precision floating-point numbers to compare. |
|
static |
Returns the larger of two double-precision floating-point numbers.
val1 | The first of two double-precision floating-point numbers to compare. |
val2 | The second of two double-precision floating-point numbers to compare. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Returns the smaller of two single-precision floating-point numbers.
val1 | The first of two single-precision floating-point numbers to compare. |
val2 | The second of two single-precision floating-point numbers to compare. |
|
static |
Returns the smaller of two double-precision floating-point numbers.
val1 | The first of two double-precision floating-point numbers to compare. |
val2 | The second of two double-precision floating-point numbers to compare. |
|
static |
static double System.Math.Pow | ( | double | x, |
double | y | ||
) |
Returns a specified number raised to the specified power.
x | A double-precision floating-point number to be raised to a power. |
y | A double-precision floating-point number that specifies a power. |
static double System.Math.Round | ( | double | a | ) |
Rounds a double-precision floating-point value to the nearest integral value.
a | A double-precision floating-point number to be rounded. |
|
static |
Rounds a double-precision floating-point value to a specified number of fractional digits.
value | A double-precision floating-point number to be rounded. |
digits | The number of fractional digits in the return value. |
T:System.ArgumentOutOfRangeException | digits is less than 0 or greater than 15. |
|
static |
Rounds a double-precision floating-point value to the nearest integer. A parameter specifies how to round the value if it is midway between two numbers.
value | A double-precision floating-point number to be rounded. |
mode | Specification for how to round value if it is midway between two other numbers. |
T:System.ArgumentException | mode is not a valid value of T:System.MidpointRounding. |
|
static |
Rounds a double-precision floating-point value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two numbers.
value | A double-precision floating-point number to be rounded. |
digits | The number of fractional digits in the return value. |
mode | Specification for how to round value if it is midway between two other numbers. |
T:System.ArgumentOutOfRangeException | digits is less than 0 or greater than 15. |
T:System.ArgumentException | mode is not a valid value of T:System.MidpointRounding. |
|
static |
Rounds a decimal value to the nearest integral value.
d | A decimal number to be rounded. |
T:System.OverflowException | The result is outside the range of a T:System.Decimal. |
|
static |
Rounds a decimal value to a specified number of fractional digits.
d | A decimal number to be rounded. |
decimals | The number of decimal places in the return value. |
T:System.ArgumentOutOfRangeException | decimals is less than 0 or greater than 28. |
T:System.OverflowException | The result is outside the range of a T:System.Decimal. |
|
static |
Rounds a decimal value to the nearest integer. A parameter specifies how to round the value if it is midway between two numbers.
d | A decimal number to be rounded. |
mode | Specification for how to round d if it is midway between two other numbers. |
T:System.ArgumentException | mode is not a valid value of T:System.MidpointRounding. |
T:System.OverflowException | The result is outside the range of a T:System.Decimal. |
|
static |
Rounds a decimal value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two numbers.
d | A decimal number to be rounded. |
decimals | The number of decimal places in the return value. |
mode | Specification for how to round d if it is midway between two other numbers. |
T:System.ArgumentOutOfRangeException | decimals is less than 0 or greater than 28. |
T:System.ArgumentException | mode is not a valid value of T:System.MidpointRounding. |
T:System.OverflowException | The result is outside the range of a T:System.Decimal. |
|
static |
Returns an integer that indicates the sign of an 8-bit signed integer.
value | A signed number. |
|
static |
Returns an integer that indicates the sign of a 16-bit signed integer.
value | A signed number. |
|
static |
Returns an integer that indicates the sign of a 32-bit signed integer.
value | A signed number. |
|
static |
Returns an integer that indicates the sign of a 64-bit signed integer.
value | A signed number. |
|
static |
Returns an integer that indicates the sign of a single-precision floating-point number.
value | A signed number. |
T:System.ArithmeticException | value is equal to F:System.Single.NaN. |
|
static |
Returns an integer that indicates the sign of a double-precision floating-point number.
value | A signed number. |
T:System.ArithmeticException | value is equal to F:System.Double.NaN. |
|
static |
Returns an integer that indicates the sign of a decimal number.
value | A signed decimal number. |
static double System.Math.Sin | ( | double | a | ) |
Returns the sine of the specified angle.
a | An angle, measured in radians. |
static double System.Math.Sinh | ( | double | value | ) |
Returns the hyperbolic sine of the specified angle.
value | An angle, measured in radians. |
static double System.Math.Sqrt | ( | double | d | ) |
Returns the square root of a specified number.
d | The number whose square root is to be found. |
static double System.Math.Tan | ( | double | a | ) |
Returns the tangent of the specified angle.
a | An angle, measured in radians. |
static double System.Math.Tanh | ( | double | value | ) |
Returns the hyperbolic tangent of the specified angle.
value | An angle, measured in radians. |
|
static |
|
static |
Calculates the integral part of a specified double-precision floating-point number.
d | A number to truncate. |
The integral part of d ; that is, the number that remains after any fractional digits have been discarded, or one of the values listed in the following table. d Return value F:System.Double.NaN
F:System.Double.NaN
F:System.Double.NegativeInfinity
F:System.Double.NegativeInfinity
F:System.Double.PositiveInfinity
F:System.Double.PositiveInfinity
const double System.Math.E = 2.7182818284590451 |
const double System.Math.PI = 3.1415926535897931 |