java.lang.Object
org.bzdev.math.Constants
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
BernoulliNumber1
(int n) Get the first Bernoulli Number.static double
BernoulliNumber2
(int n) Get the second Bernoulli Number.
-
Field Details
-
EULERS_CONSTANT
public static final double EULERS_CONSTANTEuler'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
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
-