MathF 類別

定義

提供三角函數、對數函數和其他一般數學函數的常數和靜態方法。Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.

public ref class MathF abstract sealed
public static class MathF
type MathF = class
Public Class MathF
繼承
MathF

備註

類別的靜態欄位和方法 MathF 會對應至 Math 類別的,不同之處在于其參數的類型不是,而是傳回 Single Double Single 而非 Double 值。The static fields and methods of the MathF class correspond to those of the Math class, except that their parameters are of type Single rather than Double, and they return Single rather than Double values.

欄位

E

代表自然對數底數,由常數 e 指定。Represents the natural logarithmic base, specified by the constant, e.

PI

代表圓周率,由常數 π 指定。Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.

Tau

代表單一回合中的弧度數目,由常數 τ 指定。Represents the number of radians in one turn, specified by the constant, τ.

方法

Abs(Single)

傳回單精確度浮點數的絕對值。Returns the absolute value of a single-precision floating-point number.

Acos(Single)

傳回餘弦函數 (Cosine) 是指定數字的角。Returns the angle whose cosine is the specified number.

Acosh(Single)

傳回雙曲線餘弦函數是指定數字的角。Returns the angle whose hyperbolic cosine is the specified number.

Asin(Single)

傳回正弦函數 (Sine) 是指定數字的角。Returns the angle whose sine is the specified number.

Asinh(Single)

傳回雙曲線正弦函數是指定數字的角。Returns the angle whose hyperbolic sine is the specified number.

Atan(Single)

傳回正切函數 (Tangent) 是指定數字的角。Returns the angle whose tangent is the specified number.

Atan2(Single, Single)

傳回正切函數是兩個指定數字之商數的角。Returns the angle whose tangent is the quotient of two specified numbers.

Atanh(Single)

傳回雙曲線正弦函數是指定數字的角。Returns the angle whose hyperbolic tangent is the specified number.

BitDecrement(Single)

傳回下一個比 x 小的最小值。Returns the next smallest value that compares less than x.

BitIncrement(Single)

傳回下一個大於 x 的最大值。Returns the next largest value that is greater than x.

Cbrt(Single)

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

Ceiling(Single)

傳回大於或等於所指定單精確度浮點數的最小整數值。Returns the smallest integral value that is greater than or equal to the specified single-precision floating-point number.

CopySign(Single, Single)

傳回量級為 x 且符號為 y 的值。Returns a value with the magnitude of x and the sign of y.

Cos(Single)

傳回指定角的餘弦函數。Returns the cosine of the specified angle.

Cosh(Single)

傳回指定角的雙曲線餘弦函數。Returns the hyperbolic cosine of the specified angle.

Exp(Single)

傳回具有指定乘冪數的 eReturns e raised to the specified power.

Floor(Single)

傳回小於或等於指定單精確度浮點數的最大整數值。Returns the largest integral value less than or equal to the specified single-precision floating-point number.

FusedMultiplyAdd(Single, Single, Single)

傳回 (x * y) + z,四捨五入為一個三元運算。Returns (x * y) + z, rounded as one ternary operation.

IEEERemainder(Single, Single)

傳回指定數字除以另一個指定數字所得的餘數。Returns the remainder resulting from the division of a specified number by another specified number.

ILogB(Single)

傳回以 2 為底數時指定數字的整數對數。Returns the base 2 integer logarithm of a specified number.

Log(Single)

傳回指定數字的自然 (底數為 e) 對數。Returns the natural (base e) logarithm of a specified number.

Log(Single, Single)

傳回指定底數中指定數字的對數。Returns the logarithm of a specified number in a specified base.

Log10(Single)

傳回指定數字的以 10 為底數的對數。Returns the base 10 logarithm of a specified number.

Log2(Single)

傳回以 2 為底數時指定數字的對數。Returns the base 2 logarithm of a specified number.

Max(Single, Single)

傳回兩個單精確度浮點數中較大的一個。Returns the larger of two single-precision floating-point numbers.

MaxMagnitude(Single, Single)

傳回兩個單精確度浮點數中較大的那個量級。Returns the larger magnitude of two single-precision floating-point numbers.

Min(Single, Single)

傳回兩個單精確度浮點數中較小的一個。Returns the smaller of two single-precision floating-point numbers.

MinMagnitude(Single, Single)

傳回兩個單精確度浮點數中較小的那個量級。Returns the smaller magnitude of two single-precision floating-point numbers.

Pow(Single, Single)

傳回具有指定乘冪數的指定數字。Returns a specified number raised to the specified power.

Round(Single)

將單精確度浮點數值四捨五入到最接近的整數值,並將中間點值四捨五入到最接近的偶數。Rounds a single-precision floating-point value to the nearest integral value, and rounds midpoint values to the nearest even number.

Round(Single, Int32)

將單精確度浮點數值四捨五入到小數數字的指定數字,並將中間點值四捨五入到最接近的偶數。Rounds a single-precision floating-point value to a specified number of fractional digits, and rounds midpoint values to the nearest even number.

Round(Single, Int32, MidpointRounding)

將單精確度浮點數值四捨五入到小數數字的指定數字,並使用中間點值的指定進位慣例。Rounds a single-precision floating-point value to a specified number of fractional digits, and uses the specified rounding convention for midpoint values.

Round(Single, MidpointRounding)

將單精確度浮點數值四捨五入到最接近的整數,並使用中間點值的指定進位慣例。Rounds a single-precision floating-point value to the nearest integer, and uses the specified rounding convention for midpoint values.

ScaleB(Single, Int32)

傳回有效率計算的 x * 2^n。Returns x * 2^n computed efficiently.

Sign(Single)

傳回整數,表示單精確度浮點數的正負號。Returns an integer that indicates the sign of a single-precision floating-point number.

Sin(Single)

傳回指定角的正弦函數。Returns the sine of the specified angle.

Sinh(Single)

傳回指定角的雙曲線正弦函數。Returns the hyperbolic sine of the specified angle.

Sqrt(Single)

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

Tan(Single)

傳回指定角的正切函數。Returns the tangent of the specified angle.

Tanh(Single)

傳回指定角的雙曲線正切函數。Returns the hyperbolic tangent of the specified angle.

Truncate(Single)

計算所指定單精確度浮點數的整數部分。Calculates the integral part of a specified single-precision floating-point number.

適用於