Class MathExtension

java.lang.Object
org.gvsig.utils.MathExtension

public final class MathExtension extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    log2(double a)
    2-base logarithm of a
    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)
    static double
    logX(double x_base, double a)
    X-base logarithm of a
    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)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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