Class MathUtil
Math static utility methods.
Assembly: Lucene.Net.dll
Syntax
public static class MathUtil
Methods
Acosh(double)
Calculates inverse hyperbolic cosine of a double value.
Special cases:
- If the argument is NaN, then the result is NaN.
- If the argument is +1, then the result is a zero.
- If the argument is positive infinity, then the result is positive infinity.
- If the argument is less than 1, then the result is NaN.
Declaration
public static double Acosh(double a)
Parameters
Type |
Name |
Description |
double |
a |
|
Returns
Asinh(double)
Calculates inverse hyperbolic sine of a double value.
Special cases:
- If the argument is NaN, then the result is NaN.
- If the argument is zero, then the result is a zero with the same sign as the argument.
- If the argument is infinite, then the result is infinity with the same sign as the argument.
Declaration
public static double Asinh(double a)
Parameters
Type |
Name |
Description |
double |
a |
|
Returns
Atanh(double)
Calculates inverse hyperbolic tangent of a double value.
Special cases:
- If the argument is NaN, then the result is NaN.
- If the argument is zero, then the result is a zero with the same sign as the argument.
- If the argument is +1, then the result is positive infinity.
- If the argument is -1, then the result is negative infinity.
- If the argument's absolute value is greater than 1, then the result is NaN.
Declaration
public static double Atanh(double a)
Parameters
Type |
Name |
Description |
double |
a |
|
Returns
Gcd(long, long)
Return the greatest common divisor of a
and b
,
consistently with System.Numerics.BigInteger.GreatestCommonDivisor(System.Numerics.BigInteger, System.Numerics.BigInteger)
.
NOTE: A greatest common divisor must be positive, but
2^64
cannot be expressed as a
long although it
is the GCD of
MinValue and
0
and the GCD of
MinValue and
MinValue. So in these 2 cases,
and only them, this method will return
MinValue.
Declaration
public static long Gcd(long a, long b)
Parameters
Returns
Log(double, double)
Calculates logarithm in a given base
with doubles.
Declaration
public static double Log(double @base, double x)
Parameters
Returns
Log(long, int)
Returns x <= 0 ? 0 : Math.Floor(Math.Log(x) / Math.Log(base))
.
Declaration
public static int Log(long x, int @base)
Parameters
Type |
Name |
Description |
long |
x |
|
int |
base |
Must be > 1 .
|
Returns