Package org.gvsig.utils
Class MathExtension
java.lang.Object
org.gvsig.utils.MathExtension
Some more mathematical functions that 'java.lang.Math' doesn't have:
- Logarithm operations: log2, log2Integer, logX, logXInteger
- Author:
- Pablo Piqueras Bartolomé (p_queras@hotmail.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublelog2(double a) 2-base logarithm of astatic intlog2Integer(double a) 2-base logarithm of a, but the result doesn't have decimals (approximated to the integer number most near by below)static doublelogX(double x_base, double a) X-base logarithm of astatic intlogXInteger(double x_base, double a) X-base logarithm of a, but the result doesn't have decimals (approximated to the integer number most near by below)
-
Constructor Details
-
MathExtension
public MathExtension()
-
-
Method Details
-
log2
public static double log2(double a) 2-base logarithm of a- Parameters:
a- The value to do the calculations- Returns:
- Logarithm in 2 base of 'a'
-
log2Integer
public static int log2Integer(double a) 2-base logarithm of a, but the result doesn't have decimals (approximated to the integer number most near by below)- Parameters:
a- The value to do the calculations- Returns:
- Logarithm in 2 base of 'a', as an integer
-
logX
public static double logX(double x_base, double a) X-base logarithm of a- Parameters:
a- The value to do the calculations- Returns:
- Logarithm in X base of 'a'
-
logXInteger
public static int logXInteger(double x_base, double a) X-base logarithm of a, but the result doesn't have decimals (approximated to the integer number most near by below)- Parameters:
a- The value to do the calculations- Returns:
- Logarithm in X base of 'a', as an integer
-