C# Class Lucene.Net.Util.MathUtil

Math static utility methods.
ファイルを表示 Open project: apache/lucenenet

Public Methods

Method Description
Acosh ( double a ) : double

Calculates inverse hyperbolic cosine of a {@code 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.

Asinh ( double a ) : double

Calculates inverse hyperbolic sine of a {@code 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.

Atanh ( double a ) : double

Calculates inverse hyperbolic tangent of a {@code 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.

Gcd ( long a, long b ) : long

Return the greatest common divisor of a and b, consistently with BigInteger#gcd(BigInteger).

NOTE: A greatest common divisor must be positive, but 2^64 cannot be expressed as a long although it is the GCD of Long#MIN_VALUE and 0 and the GCD of Long#MIN_VALUE and Long#MIN_VALUE. So in these 2 cases, and only them, this method will return Long#MIN_VALUE.

Log ( double @base, double x ) : double

Calculates logarithm in a given base with doubles.

Log ( long x, int @base ) : int

Returns {@code x <= 0 ? 0 : Math.floor(Math.log(x) / Math.log(base))}

Private Methods

Method Description
MathUtil ( ) : Lucene.Net.Support

Method Details

Acosh() public static method

Calculates inverse hyperbolic cosine of a {@code 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.
public static Acosh ( double a ) : double
a double
return double

Asinh() public static method

Calculates inverse hyperbolic sine of a {@code 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.
public static Asinh ( double a ) : double
a double
return double

Atanh() public static method

Calculates inverse hyperbolic tangent of a {@code 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.
public static Atanh ( double a ) : double
a double
return double

Gcd() public static method

Return the greatest common divisor of a and b, consistently with BigInteger#gcd(BigInteger).

NOTE: A greatest common divisor must be positive, but 2^64 cannot be expressed as a long although it is the GCD of Long#MIN_VALUE and 0 and the GCD of Long#MIN_VALUE and Long#MIN_VALUE. So in these 2 cases, and only them, this method will return Long#MIN_VALUE.

public static Gcd ( long a, long b ) : long
a long
b long
return long

Log() public static method

Calculates logarithm in a given base with doubles.
public static Log ( double @base, double x ) : double
@base double
x double
return double

Log() public static method

Returns {@code x <= 0 ? 0 : Math.floor(Math.log(x) / Math.log(base))}
public static Log ( long x, int @base ) : int
x long
@base int
return int