class MathF

in global :: System

Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.


public static float Abs( float x )

Returns the absolute value of a single-precision floating-point number.

  • x A number that is greater than or equal to , but less than or equal to .
  • Returns A single-precision floating-point number, x, such that 0 ≤ x ≤ .

public static float Acos( float x )

Returns the angle whose cosine is the specified number.

  • x A number representing a cosine, where must be greater than or equal to -1, but less than or equal to 1.
  • Returns An angle, θ, measured in radians, such that 0 ≤ θ ≤ π. -or- if < -1 or > 1 or equals .

public static float Acosh( float x )

Returns the angle whose hyperbolic cosine is the specified number.

  • x A number representing a hyperbolic cosine, where must be greater than or equal to 1, but less than or equal to .
  • Returns An angle, θ, measured in radians, such that 0 ≤ θ ≤ ∞. -or- if < 1 or equals .

public static float Asin( float x )

Returns the angle whose sine is the specified number.

  • x A number representing a sine, where must be greater than or equal to -1, but less than or equal to 1.
  • Returns An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. -or- if < -1 or > 1 or equals .

public static float Asinh( float x )

Returns the angle whose hyperbolic sine is the specified number.

  • x A number representing a hyperbolic sine, where must be greater than or equal to , but less than or equal to .
  • Returns An angle, θ, measured in radians, such that -∞ < θ ≤ -1, or 1 ≤ θ < ∞. -or- if equals .

public static float Atan( float x )

Returns the angle whose tangent is the specified number.

  • x A number representing a tangent.
  • Returns An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. -or- if equals , -π/2 rounded to double precision (-1.5707963267949) if equals , or π/2 rounded to double precision (1.5707963267949) if equals .

public static float Atan2( float y, float 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.
  • Returns An angle, θ, measured in radians, such that -π ≤ θ ≤ π, and tan(θ) = / , where (, ) is a point in the Cartesian plane. Observe the following: For (, ) in quadrant 1, 0 < θ < π/2. For (, ) in quadrant 2, π/2 < θ ≤ π. For (, ) in quadrant 3, -π < θ < -π/2. For (, ) in quadrant 4, -π/2 < θ < 0. For points on the boundaries of the quadrants, the return value is the following: If y is 0 and x is not negative, θ = 0. If y is 0 and x is negative, θ = π. If y is positive and x is 0, θ = π/2. If y is negative and x is 0, θ = -π/2. If y is 0 and x is 0, θ = 0. If or is , or if and are either or , the method returns .

public static float Atanh( float x )

Returns the angle whose hyperbolic tangent is the specified number.

  • x A number representing a hyperbolic tangent, where must be greater than or equal to -1, but less than or equal to 1.
  • Returns An angle, θ, measured in radians, such that -∞ < θ <-1, or 1 < θ < ∞. -or- if < -1 or > 1 or equals .

public static float Cbrt( float x )

Returns the cube root of a specified number.

  • x The number whose cube root is to be found.
  • Returns The cube root of . -or- if is equals .

public static float Ceiling( float x )

Returns the smallest integral value that is greater than or equal to the specified single-precision floating-point number.

  • x A single-precision floating-point number.
  • Returns The smallest integral value that is greater than or equal to . If is equal to , , or , that value is returned. Note that this method returns a instead of an integral type.

public static float Cos( float x )

Returns the cosine of the specified angle.

  • x An angle, measured in radians.
  • Returns The cosine of . If is equal to , , or , this method returns .

public static float Cosh( float x )

Returns the hyperbolic cosine of the specified angle.

  • x An angle, measured in radians.
  • Returns The hyperbolic cosine of . If is equal to or , is returned. If is equal to , is returned.

public static float E

Represents the natural logarithmic base, specified by the constant, .

public static float Exp( float x )

Returns raised to the specified power.

  • x A number specifying a power.
  • Returns The number raised to the power . If equals or , that value is returned. If equals , 0 is returned.

public static float Floor( float x )

Returns the largest integral value less than or equal to the specified single-precision floating-point number.

  • x A single-precision floating-point number.
  • Returns The largest integral value less than or equal to . If is equal to , , or , that value is returned.

public static float IEEERemainder( float x, float y )

Returns the remainder resulting from the division of a specified number by another specified number.

  • x A dividend.
  • y A divisor.
  • Returns A number equal to - ( Q), where Q is the quotient of / rounded to the nearest integer (if / falls halfway between two integers, the even integer is returned). If - ( Q) is zero, the value +0 is returned if is positive, or -0 if is negative. If = 0, is returned.

public static float Log( float x )

Returns the natural (base ) logarithm of a specified number.

  • x The number whose logarithm is to be found.
  • Returns One of the values in the following table. parameter Return value Positive The natural logarithm of ; that is, ln , or log e Zero Negative Equal to Equal to

public static float Log( float x, float y )

Returns the logarithm of a specified number in a specified base.

  • x The number whose logarithm is to be found.
  • Returns One of the values in the following table. (+Infinity denotes , -Infinity denotes , and NaN denotes .) Return value > 0 (0 << 1) -or-(> 1) lognewBase(a) < 0 (any value) NaN (any value) < 0 NaN != 1 = 0 NaN != 1 = +Infinity NaN = NaN (any value) NaN (any value) = NaN NaN (any value) = 1 NaN = 0 0 << 1 +Infinity = 0 > 1 -Infinity = +Infinity 0 << 1 -Infinity = +Infinity > 1 +Infinity = 1 = 0 0 = 1 = +Infinity 0

public static float Log10( float x )

Returns the base 10 logarithm of a specified number.

  • x A number whose logarithm is to be found.
  • Returns One of the values in the following table. parameter Return value Positive The base 10 log of ; that is, log 10. Zero Negative Equal to Equal to

public static float Max( float x, float y )

Returns the larger of two single-precision floating-point numbers.

  • x The first of two single-precision floating-point numbers to compare.
  • y The second of two single-precision floating-point numbers to compare.
  • Returns Parameter or , whichever is larger. If , or , or both and are equal to , is returned.

public static float Min( float x, float y )

Returns the smaller of two single-precision floating-point numbers.

  • x The first of two single-precision floating-point numbers to compare.
  • y The second of two single-precision floating-point numbers to compare.
  • Returns Parameter or , whichever is smaller. If , , or both and are equal to , is returned.

public static float PI

Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.

public static float Pow( float x, float y )

Returns a specified number raised to the specified power.

  • x A single-precision floating-point number to be raised to a power.
  • y A single-precision floating-point number that specifies a power.
  • Returns The number raised to the power .

public static float Round( float x )

Rounds a single-precision floating-point value to the nearest integral value, and rounds midpoint values to the nearest even number.

  • x A single-precision floating-point number to be rounded.
  • Returns The integer nearest . If the fractional component of is halfway between two integers, one of which is even and the other odd, then the even number is returned. Note that this method returns a instead of an integral type.

public static float Round( float x, int digits )

Rounds a single-precision floating-point value to a specified number of fractional digits, and rounds midpoint values to the nearest even number.

  • x A single-precision floating-point number to be rounded.
  • digits The number of fractional digits in the return value.
  • Returns The number nearest to that contains a number of fractional digits equal to .

public static float Round( float x, int digits, MidpointRounding mode )

Rounds a single-precision floating-point value to a specified number of fractional digits, and uses the specified rounding convention for midpoint values.

  • x A single-precision floating-point number to be rounded.
  • digits The number of fractional digits in the return value.
  • mode Specification for how to round if it is midway between two other numbers.
  • Returns The number nearest to that has a number of fractional digits equal to . If has fewer fractional digits than , is returned unchanged.

public static float Round( float x, MidpointRounding mode )

Rounds a single-precision floating-point value to the nearest integer, and uses the specified rounding convention for midpoint values.

  • x A single-precision floating-point number to be rounded.
  • mode Specification for how to round if it is midway between two other numbers.
  • Returns The integer nearest . If is halfway between two integers, one of which is even and the other odd, then determines which of the two is returned. Note that this method returns a instead of an integral type.

public static int Sign( float x )

Returns an integer that indicates the sign of a single-precision floating-point number.

  • x A signed number.
  • Returns A number that indicates the sign of , as shown in the following table. Return value Meaning -1 is less than zero. 0 is equal to zero. 1 is greater than zero.

public static float Sin( float x )

Returns the sine of the specified angle.

  • x An angle, measured in radians.
  • Returns The sine of . If is equal to , , or , this method returns .

public static float Sinh( float x )

Returns the hyperbolic sine of the specified angle.

  • x An angle, measured in radians.
  • Returns The hyperbolic sine of . If is equal to , , or , this method returns a equal to .

public static float Sqrt( float x )

Returns the square root of a specified number.

  • x The number whose square root is to be found.
  • Returns One of the values in the following table. parameter Return value Zero or positive The positive square root of . Negative Equals Equals

public static float Tan( float x )

Returns the tangent of the specified angle.

  • x An angle, measured in radians.
  • Returns The tangent of . If is equal to , , or , this method returns .

public static float Tanh( float x )

Returns the hyperbolic tangent of the specified angle.

  • x An angle, measured in radians.
  • Returns The hyperbolic tangent of . If is equal to , this method returns -1. If value is equal to , this method returns 1. If is equal to , this method returns .

public static float Truncate( float x )

Calculates the integral part of a specified single-precision floating-point number.

  • x A number to truncate.
  • Returns The integral part of ; that is, the number that remains after any fractional digits have been discarded, or one of the values listed in the following table. Return value

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public static float ScaleB( float x, int n )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public static float Tau

😔 No documentation found.

public static float ReciprocalEstimate( float x )

😔 No documentation found.

public static float MinMagnitude( float x, float y )

😔 No documentation found.

public static float MaxMagnitude( float x, float y )

😔 No documentation found.

public static int ILogB( float x )

😔 No documentation found.

public static float CopySign( float x, float y )

😔 No documentation found.

public static float BitIncrement( float x )

😔 No documentation found.

public static ValueTuple<float,float> SinCos( float x )

😔 No documentation found.

public static float Log2( float x )

😔 No documentation found.

public static float FusedMultiplyAdd( float x, float y, float z )

😔 No documentation found.

public static float ReciprocalSqrtEstimate( float x )

😔 No documentation found.

public static float BitDecrement( float x )

😔 No documentation found.