Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class MathUtil

    Math static utility methods.

    Inheritance
    System.Object
    MathUtil
    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()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public static class MathUtil

    Methods

    | Improve this Doc View Source

    Acosh(Double)

    Calculates inverse hyperbolic cosine of a System.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
    System.Double a
    Returns
    Type Description
    System.Double
    | Improve this Doc View Source

    Asinh(Double)

    Calculates inverse hyperbolic sine of a System.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
    System.Double a
    Returns
    Type Description
    System.Double
    | Improve this Doc View Source

    Atanh(Double)

    Calculates inverse hyperbolic tangent of a System.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
    System.Double a
    Returns
    Type Description
    System.Double
    | Improve this Doc View Source

    Gcd(Int64, Int64)

    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 System.Int64 although it is the GCD of System.Int64.MinValue and 0 and the GCD of System.Int64.MinValue and System.Int64.MinValue. So in these 2 cases, and only them, this method will return System.Int64.MinValue.

    Declaration
    public static long Gcd(long a, long b)
    Parameters
    Type Name Description
    System.Int64 a
    System.Int64 b
    Returns
    Type Description
    System.Int64
    | Improve this Doc View Source

    Log(Double, Double)

    Calculates logarithm in a given base with doubles.

    Declaration
    public static double Log(double base, double x)
    Parameters
    Type Name Description
    System.Double base
    System.Double x
    Returns
    Type Description
    System.Double
    | Improve this Doc View Source

    Log(Int64, Int32)

    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
    System.Int64 x
    System.Int32 base

    Must be > 1.

    Returns
    Type Description
    System.Int32
    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.