Class Constants

java.lang.Object
org.bzdev.math.Constants

public class Constants extends Object
Class defining various mathematical constants. This class provides additional constants besides the ones provided by java.lang.Math (E and PI).

Some are implemented as static methods (e.g., Bernoulli numbers - there are an infinite number of these, but only a finite subset can be represented as double-precision constants).

  • Field Details

    • EULERS_CONSTANT

      public static final double EULERS_CONSTANT
      Euler's Constant.
      See Also:
  • Constructor Details

    • Constants

      public Constants()
  • Method Details

    • BernoulliNumber1

      public static double BernoulliNumber1(int n)
      Get the first Bernoulli Number.
      Parameters:
      n - the index for the number (must be non-negative)
      Returns:
      the first Bernoulli number Bn; negative or positive infinity if the number is too large to be represented as a double-precision number
      Throws:
      IllegalArgumentException - the argument was negative
    • BernoulliNumber2

      public static double BernoulliNumber2(int n) throws IllegalArgumentException
      Get the second Bernoulli Number.
      Parameters:
      n - the index for the number (must be non-negative)
      Returns:
      the second Bernoulli number Bn; negative or positive infinity if the number is too large to be represented as a double-precision number
      Throws:
      IllegalArgumentException - the argument was negative