Class Tools
Set of mathematical tools.
Inheritance
System.Object
Tools
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Mars.Numerics.dll
public static class Tools
Methods
|
Improve this Doc
View Source
Returns the hyperbolic arc cosine of the specified value.
Declaration
public static double Acosh(double x)
Parameters
Type |
Name |
Description |
System.Double |
x |
|
Returns
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
Returns the hyperbolic arc sine of the specified value.
Declaration
public static double Asinh(double d)
Parameters
Type |
Name |
Description |
System.Double |
d |
|
Returns
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
Returns the hyperbolic arc tangent of the specified value.
Declaration
public static double Atanh(double d)
Parameters
Type |
Name |
Description |
System.Double |
d |
|
Returns
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
Hypotenuse calculus without overflow/underflow
Declaration
public static double Hypotenuse(double a, double b)
Parameters
Type |
Name |
Description |
System.Double |
a |
First value |
System.Double |
b |
Second value |
Returns
Type |
Description |
System.Double |
The hypotenuse Sqrt(a^2 + b^2) |
|
Improve this Doc
View Source
Hypotenuse calculus without overflow/underflow
Declaration
public static float Hypotenuse(float a, float b)
Parameters
Type |
Name |
Description |
System.Single |
a |
first value |
System.Single |
b |
second value |
Returns
Type |
Description |
System.Single |
The hypotenuse Sqrt(a^2 + b^2) |
|
Improve this Doc
View Source
Fast inverse floating-point square root.
Declaration
public static float InvSqrt(float f)
Parameters
Type |
Name |
Description |
System.Single |
f |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Checks if the specified integer is power of 2.
Declaration
public static bool IsPowerOf2(int x)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
Integer number to check. |
Returns
Type |
Description |
System.Boolean |
Returns true if the specified number is power of 2.
Otherwise returns false.
|
|
Improve this Doc
View Source
Gets the maximum value among three values.
Declaration
public static double Max(double a, double b, double c)
Parameters
Type |
Name |
Description |
System.Double |
a |
The first value a . |
System.Double |
b |
The second value b . |
System.Double |
c |
The third value c . |
Returns
Type |
Description |
System.Double |
The maximum value among a ,
b and c .
|
|
Improve this Doc
View Source
Gets the minimum value among three values.
Declaration
public static double Min(double a, double b, double c)
Parameters
Type |
Name |
Description |
System.Double |
a |
The first value a . |
System.Double |
b |
The second value b . |
System.Double |
c |
The third value c . |
Returns
Type |
Description |
System.Double |
The minimum value among a ,
b and c .
|
|
Improve this Doc
View Source
Returns the next power of 2 after the input value x.
Declaration
public static int NextPowerOf2(int x)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
Input value x. |
Returns
Type |
Description |
System.Int32 |
Returns the next power of 2 after the input value x. |
|
Improve this Doc
View Source
Returns the previous power of 2 after the input value x.
Declaration
public static int PreviousPowerOf2(int x)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
Input value x. |
Returns
Type |
Description |
System.Int32 |
Returns the previous power of 2 after the input value x. |