Java org.apache.commons.math.util MathUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.math.util MathUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.math.util MathUtils.

The text is from its open source code.

Field

doubleEPSILON
Smallest positive number such that 1 - EPSILON is not numerically equal to 1.
doubleTWO_PI
2 π.

Method

longbinomialCoefficient(final int n, final int k)
Returns an exact representation of the Binomial Coefficient, "n choose k", the number of k-element subsets that can be selected from an n-element set.
doublebinomialCoefficientDouble(final int n, final int k)
Returns a double representation of the Binomial Coefficient, "n choose k", the number of k-element subsets that can be selected from an n-element set.
intcompareTo(double x, double y, double eps)
Compares two numbers given some amount of allowed error.
doublecosh(double x)
Returns the hyperbolic cosine of x.
doubledistance(double[] p1, double[] p2)
Calculates the L2 (Euclidean) distance between two points.
doubledistance(int[] p1, int[] p2)
Calculates the L2 (Euclidean) distance between two points.
booleanequals(float x, float y)
Returns true iff they are strictly equal.
booleanequals(float[] x, float[] y)
Returns true iff both arguments are null or have same dimensions and all their elements are equal as defined by #equals(float,float) .
booleanequals(double x, double y)
Returns true iff both arguments are NaN or neither is NaN and they are equal

This method considers that NaN == NaN .

booleanequals(double[] x, double[] y)
Returns true iff both arguments are null or have same dimensions and all their elements are equal as defined by #equals(double,double) .
booleanequals(float x, float y, float eps)
Returns true if both arguments are equal or within the range of allowed error (inclusive).
booleanequals(float x, float y, int maxUlps)
Returns true if both arguments are equal or within the range of allowed error (inclusive).
booleanequals(double x, double y, double eps)
Returns true if both arguments are equal or within the range of allowed error (inclusive).
booleanequals(double x, double y, int maxUlps)
Returns true if both arguments are equal or within the range of allowed error (inclusive).
booleanequalsIncludingNaN(float x, float y, float eps)
Returns true if both arguments are NaN or are equal or within the range of allowed error (inclusive).
booleanequalsIncludingNaN(float x, float y, int maxUlps)
Returns true if both arguments are NaN or if they are equal as defined by #equals(float,float,int) equals(x, y, maxUlps) .
booleanequalsIncludingNaN(double x, double y, double eps)
Returns true if both arguments are NaN or are equal or within the range of allowed error (inclusive).
booleanequalsIncludingNaN(double x, double y, int maxUlps)
Returns true if both arguments are NaN or if they are equal as defined by #equals(double,double,int) equals(x, y, maxUlps .
longfactorial(final int n)
Returns n!.
doublefactorialDouble(final int n)
Returns n!.
doublefactorialLog(final int n)
Returns the natural logarithm of n!.
intgcd(final int p, final int q)

Gets the greatest common divisor of the absolute value of two numbers, using the "binary gcd" method which avoids division and modulo operations.

longgcd(final long p, final long q)

Gets the greatest common divisor of the absolute value of two numbers, using the "binary gcd" method which avoids division and modulo operations.

inthash(double value)
Returns an integer hash code representing the given double value.
inthash(double[] value)
Returns an integer hash code representing the given double array.
intlcm(int a, int b)

Returns the least common multiple of the absolute value of two numbers, using the formula lcm(a,b) = (a / gcd(a,b)) * b.

longlcm(long a, long b)

Returns the least common multiple of the absolute value of two numbers, using the formula lcm(a,b) = (a / gcd(a,b)) * b.

doublelog(double base, double x)

Returns the logarithm for base b of x.

doublenormalizeAngle(double a, double center)
Normalize an angle in a 2&pi wide interval around a center value.
intpow(final int k, int e)
Raise an int to an int power.
intpow(final int k, long e)
Raise an int to a long power.
longpow(final long k, int e)
Raise a long to an int power.
longpow(final long k, long e)
Raise a long to a long power.
BigIntegerpow(final BigInteger k, int e)
Raise a BigInteger to an int power.
BigIntegerpow(final BigInteger k, long e)
Raise a BigInteger to a long power.
BigIntegerpow(final BigInteger k, BigInteger e)
Raise a BigInteger to a BigInteger power.
doubleround(double x, int scale)
Round the given value to the specified number of decimal places.
floatround(float x, int scale)
Round the given value to the specified number of decimal places.
doubleround(double x, int scale, int roundingMethod)
Round the given value to the specified number of decimal places.
floatround(float x, int scale, int roundingMethod)
Round the given value to the specified number of decimal places.
bytesign(final byte x)
Returns the sign for byte value x.
doublesign(final double x)
Returns the sign for double precision x.
floatsign(final float x)
Returns the sign for float value x.
intsign(final int x)
Returns the sign for int value x.
longsign(final long x)
Returns the sign for long value x.
shortsign(final short x)
Returns the sign for short value x.